Skip to content

Commit c051814

Browse files
Add logic to run when new tag created (#66)
* CI: Added logic to run when new tag created
1 parent 6a160d6 commit c051814

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/CI.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
branches: [ master ]
1010
pull_request:
1111
branches: [ master ]
12+
# Trigger when a tag is created
13+
create:
1214

1315
# Allows you to run this workflow manually from the Actions tab
1416
workflow_dispatch:
@@ -23,6 +25,9 @@ jobs:
2325
# The type of runner that the job will run on
2426
runs-on: ${{ matrix.os }}
2527

28+
# Only run with create event if new tag, not new branch
29+
if: github.event_name != 'create' || (github.event_name == 'create' && startsWith(github.ref, 'refs/tags'))
30+
2631
env:
2732
FC: gfortran
2833
OMPI_FC: gfortran
@@ -61,12 +66,12 @@ jobs:
6166
- name: Prepare release
6267
if: startsWith(github.ref, 'refs/tags/')
6368
run: |
64-
tar --transform 's,build,libaccessom2,' -cvf binary_release_${{ env.os_version}}.tar build/lib/ build/include/
69+
tar --transform 's,build,libaccessom2,' -zcvf binary_release_${{ env.os_version}}.tar.gz build/lib/ build/include/
6570
6671
- name: Release
6772
uses: softprops/action-gh-release@v1
6873
if: startsWith(github.ref, 'refs/tags/')
6974
with:
70-
files: "binary_release-*.tar.gz"
75+
files: "binary_release_*.tar.gz"
7176
env:
7277
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)