diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c05b3182..f84f23c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,12 @@ on: inputs: branch: description: Branch - pull_request: # TODO: only for testing + dry_run: + description: Dry Run + type: boolean + default: false + # TODO: only for testing + pull_request: branches: "*" jobs: @@ -34,15 +39,16 @@ jobs: sha256sum bin/lucky | awk '{print $1}' > ./bin/checksums.txt tar -czvf lucky-linux-amd64.tar.gz -C ./bin . - uses: actions/upload-artifact@v4 + if: ${{ !github.event.inputs.dry_run }} with: - name: lucky-linux-amd64 + name: linux path: lucky-linux-amd64.tar.gz if-no-files-found: error build-windows-amd64: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.branch }} - uses: crystal-lang/install-crystal@v1 @@ -53,8 +59,9 @@ jobs: (Get-FileHash ./bin/lucky.exe).Hash | Out-File ./bin/checksums.txt Compress-Archive -Path ./bin/* -DestinationPath lucky-windows-amd64.zip - uses: actions/upload-artifact@v4 + if: ${{ !github.event.inputs.dry_run }} with: - name: lucky-windows-amd64 + name: windows path: lucky-windows-amd64.zip if-no-files-found: error @@ -65,13 +72,17 @@ jobs: - build-windows-amd64 runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} - uses: actions/download-artifact@v4 + with: + path: artifacts - name: Release uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') with: draft: true fail_on_unmatched_files: true files: | - lucky-linux-amd64/lucky-linux-amd64.tar.gz - lucky-windows-amd64/lucky-windows-amd64.zip + artifacts/linux/lucky-linux-amd64.tar.gz + artifacts/windows/lucky-windows-amd64.zip