-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce soot wrapper build job (#198)
* Introduce soot wrapper build job * Attach JARs to existing release
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,51 @@ permissions: | |
contents: write | ||
|
||
jobs: | ||
soot-wrapper: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java-version: [ 11, 17, 21 ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'debricked/soot-wrapper' | ||
|
||
- name: Calculate checksum | ||
id: calc-checksum | ||
run: echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache JARs | ||
uses: actions/cache@v4 | ||
id: cache-jars | ||
with: | ||
path: | | ||
java/common/target/*.jar | ||
key: ${{ runner.os }}-soot-wrapper-${{ matrix.java-version }}-${{ steps.calc-checksum.outputs.hash }} | ||
|
||
- name: Set up JDK ${{ matrix.java-version }} | ||
if: steps.cache-jars.outputs.cache-hit != 'true' | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
distribution: 'adopt' | ||
|
||
- name: Build with Maven | ||
if: steps.cache-jars.outputs.cache-hit != 'true' | ||
run: | | ||
cd java/common/ | ||
mvn clean package -X -DskipTests | ||
- name: Upload JAR if cache missed | ||
if: steps.cache-jars.outputs.cache-hit != 'true' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: soot-wrapper-${{ matrix.java-version }}.jar | ||
path: java/common/target/*.jar | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: soot-wrapper | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -20,16 +63,19 @@ jobs: | |
with: | ||
go-version: '>=1.20' | ||
cache: true | ||
|
||
- name: Import GPG signing key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Pull Supported Formats | ||
run: | | ||
cd cmd/debricked | ||
go generate -v -x | ||
- uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
|
@@ -39,6 +85,19 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
|
||
- name: Download JARs | ||
uses: actions/download-artifact@v4 | ||
|
||
- name: Add JARs to release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
tag_name: ${{ github.ref_name }} | ||
files: | | ||
soot-wrapper-11.jar | ||
soot-wrapper-17.jar | ||
soot-wrapper-21.jar | ||
aur: | ||
runs-on: ubuntu-latest | ||
needs: goreleaser | ||
|
@@ -49,10 +108,12 @@ jobs: | |
run: | | ||
pacman -Syu --noconfirm git go openssh pacman-contrib | ||
useradd -m aur | ||
# Setup SSH access to aur.archlinux.org | ||
- uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | ||
|
||
# Now actually clone AUR repo, and update to new version | ||
- name: Build package and update AUR | ||
run: | | ||
|