diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17e9398..3c3f091 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,17 +29,45 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - args: --release --verbose + args: --release --verbose - - name: Upload Built Binary + - name: Upload Non-Windows Built Binary if: runner.os != 'Windows' uses: actions/upload-artifact@v1 with: name: soundsense-rs-${{runner.os}} path: target/release/soundsense-rs - - name: Upload Built Binary + + - name: Upload Windows Built Binary if: runner.os == 'Windows' uses: actions/upload-artifact@v1 with: name: soundsense-rs-${{runner.os}} - path: target/release/soundsense-rs.exe \ No newline at end of file + path: target/release/soundsense-rs.exe + + + - name: Version + if: startsWith(github.ref, 'refs/tags/v') + shell: bash + id: version_id + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Package release not Windows + if: startsWith(github.ref, 'refs/tags/v') && runner.os != 'Windows' + run: tar cjf soundsense-rs-${{ steps.version_id.outputs.VERSION }}-${{runner.os}}.tbz -C target/release/ soundsense-rs + - name: Package release win + if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'Windows' + shell: bash + run: 7z a soundsense-rs-${{ steps.version_id.outputs.VERSION }}-Windows.zip ./target/release/soundsense-rs.exe + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/v') + with: + body: | + Files generated by github action + files: | + soundsense-rs-*-*.tbz + soundsense-rs-*-Windows.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}