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

Add build and push release tags automation to onebranch #297

Closed
wants to merge 1 commit into from
Closed
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
34 changes: 34 additions & 0 deletions .github/workflows/onebranch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: OneBranch-Style Build
on:
push:
branches: main
tags: # Trigger when a tag is pushed
- 'v*' # Match tags starting with 'v'
pull_request:
branches: main

Expand Down Expand Up @@ -41,3 +43,35 @@ jobs:
build/bin/**/quicreach
build/bin/**/quicreach.exe
build/bin/**/quicreach.msi

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }} # Use the tag that triggered the workflow
release_name: Release ${{ github.ref_name }}
body: |
## Release Notes
Automated release for tag ${{ github.ref_name }}.
draft: false
prerelease: false

- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/bin/**/*.msi
asset_name: quicreach-${{ github.ref_name }}-${{ matrix.arch }}.msi
asset_content_type: application/octet-stream