forked from cloudevents/sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 2.82 KB
/
release.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Release Pipeline
on:
push:
branches:
- release-*
jobs:
semver:
name: Calculate Next Release
runs-on: ubuntu-latest
outputs:
next: ${{ steps.ggsv.outputs.next}}
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache-dependency-path: v2/go.sum
- name: Install Dependencies
run: go install tableflip.dev/ggsv@latest
- name: Look at Ref
id: ggsv
run: |
NEXT=`ggsv next-patch $GITHUB_SERVER_URL/${{ github.repository }}.git ${{ github.ref }}`
echo "::set-output name=next::$NEXT"
mainmodule:
name: Release Main Module
runs-on: ubuntu-latest
needs: semver
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Create Release ${{ needs.semver.outputs.next }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.semver.outputs.next }}
release_name: Release ${{ needs.semver.outputs.next }}
prerelease: false
submodules:
name: Release Sub-Modules
runs-on: ubuntu-latest
needs:
- semver
- mainmodule
env:
VERSION: ${{ needs.semver.outputs.next }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache-dependency-path: v2/go.sum
- run: git pull
- name: Update Modules
run: |
./hack/tag-release.sh
- name: Commit Repoint
run: |
git config user.name github-actions
git config user.email [email protected]
git diff-index --quiet HEAD || (git commit -a -m "Repoint modules for release ${{ needs.semver.outputs.next }}." --allow-empty && git push)
- name: Tag Modules
run: ./hack/tag-release.sh --tag --push
examples:
name: Update Examples
runs-on: ubuntu-latest
needs:
- semver
- mainmodule
- submodules
env:
VERSION: ${{ needs.semver.outputs.next }}
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
cache-dependency-path: v2/go.sum
- name: Checkout Code
uses: actions/checkout@v4
- run: git pull
- name: Update Examples
run: ./hack/tag-release.sh --samples
- name: Commit Repoint
env:
tag: ${{ matrix.module }}/${{ needs.semver.outputs.next }}
run: |
git config user.name github-actions
git config user.email [email protected]
git diff-index --quiet HEAD || (git commit -a -m "Repoint examples, post release ${{ needs.semver.outputs.next }}." --allow-empty && git push)