Skip to content

Commit b377e9c

Browse files
committed
Auto create snapshots on main
1 parent 169f800 commit b377e9c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
pull_request:
44
push:
55
tags:
6-
- v*
6+
- '*'
77
branches:
88
- main
99

@@ -183,12 +183,12 @@ jobs:
183183
run: |
184184
cpack -C ${{matrix.build_type}} -G ${{matrix.package_generator}}
185185
186-
- name: Release
186+
- name: Publish Release
187187
uses: softprops/action-gh-release@v1
188-
if: ${{ (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') && matrix.package_generator != '' }}
188+
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.package_generator != '' }}
189189
with:
190190
files: |
191-
build/*-*-*${{ matrix.build_type }}*-*-*.*
191+
build/*-*${{ matrix.build_type }}*-*.*
192192
193193
- name: Publish to codecov
194194
uses: codecov/codecov-action@v2
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: create-snapshots
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Create tag
13+
uses: actions/github-script@v5
14+
with:
15+
script: |
16+
github.rest.git.createRef({
17+
owner: context.repo.owner,
18+
repo: context.repo.repo,
19+
ref: 'refs/tags/snapshot-${{ github.sha }}',
20+
sha: context.sha
21+
})
22+

0 commit comments

Comments
 (0)