-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Release on Tag | ||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
# Pick a branch to generate a new build | ||
branches: [ master ] | ||
|
||
jobs: | ||
# We define the commit hash and also create the release just once or there are errors | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# We can access this values in the other jobs | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
version: ${{ steps.get_version.outputs.version }} | ||
#sha_short: ${{ steps.vars.outputs.sha_short }} | ||
steps: | ||
# This enable to get the commit and can be used for nightly or dev builds | ||
#- name: Checkout repo | ||
# uses: actions/checkout@v2 | ||
#- name: Declare Commit Hash | ||
# id: vars | ||
# shell: bash | ||
# run: | | ||
# echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ steps.get_version.outputs.version }} | ||
draft: false | ||
prerelease: false | ||
|
||
build-ubuntu: | ||
runs-on: ubuntu-latest | ||
needs: [create-release] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Package project | ||
run: zip --junk-paths matrix matrix.hpp | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: ./matrix.zip | ||
asset_name: matrix-${{ needs.create-release.outputs.version }}.zip | ||
asset_content_type: application/zip | ||
|