diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c9f439..fe03d80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,8 @@ on: [push, workflow_dispatch] jobs: build: runs-on: ubuntu-latest + outputs: + artifact_name: ${{ steps.set_artifact_name.outputs.artifact_name }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -20,3 +22,34 @@ jobs: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register" ./build.sh + - name: Set artifact name + id: set_artifact_name + run: echo "artifact_name=sanoid-portable.${{ github.sha }}.${{ github.run_id }}" >> $GITHUB_OUTPUT + - uses: actions/upload-artifact@v4 + with: + name: ${{ steps.set_artifact_name.outputs.artifact_name }} + path: output/sanoid-portable + if-no-files-found: error + retention-days: 5 + + test: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download sanoid-portable artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.build.outputs.artifact_name }} + path: sanoid-portable + - name: Test sanoid-portable + run: | + ./sanoid-portable -h + + ln -s sanoid-portable sanoid + ./sanoid -h + + ln -s sanoid-portable syncoid + ./syncoid -h + + ln -s sanoid-portable findoid + ./findoid -h