Skip to content

Commit

Permalink
chore: add workflow to create release drafts
Browse files Browse the repository at this point in the history
  • Loading branch information
pcvolkmer committed Jun 7, 2024
1 parent 2b94618 commit fa34eff
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Create release and upload assets

on:
push:
tags:
- 'v*'

jobs:
linuxbuild:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose
- run: make linux-package
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: 'true'
make_latest: 'true'
generate_release_notes: 'true'
files: |
*linux.tar.gz
windowsbuild:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --verbose
- run: make win-package
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: 'true'
make_latest: 'true'
generate_release_notes: 'true'
files: |
*win64.zip
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ win-package: win-binary-x86_64
cp target/x86_64-pc-windows-gnu/release/$(PROG_NAME).exe $(PROG_NAME)/
cp README.md $(PROG_NAME)/
cp LICENSE $(PROG_NAME)/
zip $(PROG_NAME)-$(TAG)_win64.zip $(PROG_NAME)/*
# first try linux zip command, then windows tar command to create ZIP file
zip $(PROG_NAME)-$(TAG)_win64.zip $(PROG_NAME)/* || tar -a -c -f $(PROG_NAME)-$(TAG)_win64.zip $(PROG_NAME)/*
rm -rf $(PROG_NAME) || true

.PHONY: linux-package
Expand Down

0 comments on commit fa34eff

Please sign in to comment.