-
Notifications
You must be signed in to change notification settings - Fork 2
142 lines (114 loc) · 5.12 KB
/
build-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# This workflow builds the API and releases it to Maven-Sonatype-Central repository
name: Build and deploy jSnapLoader
# Runs this workflow [on-release] only
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
release:
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
jobs:
compile-assemble:
# runner images with architectures (variants)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Compile java and assemble jar
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3
- name: Setup Temurin-OpenJDK-19
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
- name: Compiling java
run: ./gradlew --console="verbose" -Pversion=${GITHUB_REF_NAME} :snaploader:build
- name: Archive build
uses: actions/upload-artifact@v3
with:
name: snaploader-build
path: snaploader/build/libs
deploy:
environment:
name: maven-central
url: https://repo.maven.apache.org/maven2/io/github/electrostat-lab
runs-on: ${{ matrix.os }}
needs: [compile-assemble]
strategy:
matrix:
os: [ 'ubuntu-latest' ]
name: Deploying to Maven-Central repository
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Job
uses: actions/checkout@v3
- name: Setup Temurin-OpenJDK-19
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '19'
- name: Setup maven-3.9
run: |
# remove shipped maven-3.8 that causes the plexus plugin incompatibility behavior
sudo apt remove maven
# installs maven-3.9 with the fixed plugins patch
chmod +rwx ./helper-scripts/project-impl/publishing/install-maven-latest.sh
./helper-scripts/project-impl/publishing/install-maven-latest.sh
- name: Use Predefined PGP Keybox
run: gpg --import ./helper-scripts/project-impl/publishing/avrsandbox.pub
- name: Import secret-key
run: gpg --allow-secret-key-import --import --batch --yes --passphrase="avrsandbox" ./helper-scripts/project-impl/publishing/secret-key
- name: Import owner-trust
run: gpg --import-ownertrust ./helper-scripts/project-impl/publishing/owner-trust.txt
- name: Send public key 'avrsandbox'
# sends the public key to a maven compatible host
run: gpg --keyserver keyserver.ubuntu.com --send-keys 85A57D4975B6EE2B6D0EA46903DE10B9F12F0B20
- name: Generate sources jar
run: ./gradlew -Pversion=$GITHUB_REF_NAME :snaploader:generateSourcesJar
- name: Generate javadoc jar
run: ./gradlew -Pversion=$GITHUB_REF_NAME :snaploader:generateJavadocJar
- name: Download build
uses: actions/download-artifact@v3
with:
name: snaploader-build
path: snaploader/build/libs/
- name: Deploying snaploader binaries
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
run: |
chmod +rwx ./helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh
# publish artifacts using the tag version
./helper-scripts/project-impl/publishing/sonatype-publish-artifacts.sh $GITHUB_REF_NAME
# deploy-doc:
# environment:
# name: release-documentation
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Generate javadoc
# run: chmod +rwx ./gradlew && ./gradlew :jme3-alloc:generateJavadocJar
# - name: Move javadocs to the deployment folder 'website'
# run: ./gradlew -Pversion=${GITHUB_REF_NAME} :jme3-alloc:manipulateJavadocForWebsite
# - name: Setup Pages
# uses: actions/configure-pages@v3
# - name: Build with Jekyll
# uses: actions/jekyll-build-pages@v1
# with:
# source: ./website
# destination: ./_site
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v1