Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release with tagname action #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 }}