Skip to content

Commit

Permalink
Check downloaded artifacts structure (#205)
Browse files Browse the repository at this point in the history
* Check downloaded artifacts structure

* Archive generated JAR files

* Cleanup soot-wrapper-test

* Fix typo

* Troubleshoot archive error

* Overwrite artifacts

* Troubleshoot archive error

* Fix JARs attachment
  • Loading branch information
4ernovm authored Feb 23, 2024
1 parent 2a4dc25 commit 8d66cfc
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,10 @@ jobs:
- name: Pull JAR from previous release if already built
if: steps.calc-checksum.outputs.hash == steps.calc-checksum.outputs.prev_hash
run: |
curl -LJO https://github.com/${{ github.repository }}/releases/download/${{ steps.calc-checksum.outputs.release_tag }}/soot-wrapper-${{ matrix.java-version }}.jar
curl -LJO https://github.com/${{ github.repository }}/releases/download/${{ steps.calc-checksum.outputs.release_tag }}/soot-wrapper-${{ matrix.java-version }}.zip
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload JAR from previous release
if: steps.calc-checksum.outputs.hash == steps.calc-checksum.outputs.prev_hash
uses: actions/upload-artifact@v4
with:
name: soot-wrapper-${{ matrix.java-version }}.jar
path: soot-wrapper-${{ matrix.java-version }}.jar

- name: Set up JDK ${{ matrix.java-version }}
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash
uses: actions/setup-java@v4
Expand All @@ -59,12 +52,12 @@ jobs:
cd java/common/
mvn clean package -X -DskipTests
- name: Upload generated JAR
- name: Create archive with generated JARs
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash
uses: actions/upload-artifact@v4
with:
name: soot-wrapper-${{ matrix.java-version }}.jar
path: java/common/target/*.jar
run: |
cd java/common/target/
zip -r soot-wrapper-${{ matrix.java-version }}.zip *.jar
mv soot-wrapper-${{ matrix.java-version }}.zip ../../../soot-wrapper-${{ matrix.java-version }}.zip
- name: Store soot-wrapper revision hash
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash
Expand All @@ -79,6 +72,13 @@ jobs:
path: soot-wrapper-rev-hash.txt
overwrite: 'true'

- name: Upload the archive
uses: actions/upload-artifact@v4
with:
name: soot-wrapper-${{ matrix.java-version }}.zip
path: soot-wrapper-${{ matrix.java-version }}.zip
overwrite: 'true'

goreleaser:
runs-on: ubuntu-latest
needs: soot-wrapper
Expand Down Expand Up @@ -115,19 +115,19 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

- name: Download JARs
- name: Download JAR archives
uses: actions/download-artifact@v4

- name: Add JARs to release
- name: Add archives with JARs to release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
files: |
/home/runner/work/cli/cli/soot-wrapper-rev-hash.txt
/home/runner/work/cli/cli/soot-wrapper-11.jar
/home/runner/work/cli/cli/soot-wrapper-17.jar
/home/runner/work/cli/cli/soot-wrapper-21.jar
soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt
soot-wrapper-11.zip/soot-wrapper-11.zip
soot-wrapper-17.zip/soot-wrapper-17.zip
soot-wrapper-21.zip/soot-wrapper-21.zip
aur:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8d66cfc

Please sign in to comment.