-
Notifications
You must be signed in to change notification settings - Fork 240
68 lines (63 loc) · 1.82 KB
/
ci-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI - Dev
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
# push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
test:
uses:
./.github/workflows/test.yml
# create a dev tag for every branch except master
tag_version:
needs: test
if: ${{ github.ref_type == 'branch' && github.ref_name != 'master' }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.next }}
tag: v${{ steps.version.outputs.next }}
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Get version number
id: version
run: |
echo "next=$(go run ./tools/version next)" >> "$GITHUB_OUTPUT"
- name: Print version number
run: |
echo "### Release Info :rocket:" >> $GITHUB_STEP_SUMMARY
echo "Version: ${{ steps.version.outputs.next }}" >> $GITHUB_STEP_SUMMARY
- name: Create tag
uses: actions/github-script@v6
env:
TAG_NAME: v${{ steps.version.outputs.next }}
with:
script: |
const { TAG_NAME } = process.env
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${TAG_NAME}`,
sha: context.sha
})
# build and release the dev tag to flypkgs
build_and_release:
uses:
./.github/workflows/release.yml
needs: tag_version
with:
version: ${{ needs.tag_version.outputs.version }}
tag: ${{ needs.tag_version.outputs.tag }}
secrets: inherit