Skip to content

Commit

Permalink
Introduce soot wrapper build job (#198)
Browse files Browse the repository at this point in the history
* Introduce soot wrapper build job

* Attach JARs to existing release
  • Loading branch information
4ernovm authored Feb 19, 2024
1 parent c2ecae6 commit 930fb84
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit 930fb84

Please sign in to comment.