Check downloaded artifacts structure #21
Workflow file for this run
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
name: Release | |
on: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
soot-wrapper-test: | |
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: | | |
TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tag_name') | |
curl -LJO https://github.com/${{ github.repository }}/releases/download/${TAG}/soot-wrapper-rev-hash.txt | |
echo "release_tag=$TAG" >> $GITHUB_OUTPUT | |
echo "hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
if [ ! -f soot-wrapper-rev-hash.txt ]; then | |
touch soot-wrapper-rev-hash.txt | |
fi | |
echo "prev_hash=$(cat soot-wrapper-rev-hash.txt)" >> $GITHUB_OUTPUT | |
- 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 }}.zip | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK ${{ matrix.java-version }} | |
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'adopt' | |
- name: Build with Maven | |
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash | |
run: | | |
cd java/common/ | |
mvn clean package -X -DskipTests | |
- name: Create archive with generated JARs | |
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash | |
run: | | |
zip -r soot-wrapper-${{ matrix.java-version }}.zip java/common/target/*.jar | |
ls -la | |
- name: Store soot-wrapper revision hash | |
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash | |
run: | | |
echo ${{ steps.calc-checksum.outputs.hash }} > soot-wrapper-rev-hash.txt | |
- name: Upload file containing soot-wrapper revision hash | |
if: steps.calc-checksum.outputs.hash != steps.calc-checksum.outputs.prev_hash | |
uses: actions/upload-artifact@v4 | |
with: | |
name: soot-wrapper-rev-hash.txt | |
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 | |
goreleaser-test: | |
runs-on: ubuntu-latest | |
needs: soot-wrapper-test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: git fetch --force --tags | |
- name: Download JARs | |
uses: actions/download-artifact@v4 | |
- name: Ensure files are in place | |
run: | | |
ls -la soot-wrapper-11.zip | |
ls -la soot-wrapper-17.zip | |
ls -la soot-wrapper-21.zip | |
cat soot-wrapper-rev-hash.txt/soot-wrapper-rev-hash.txt |