-
Notifications
You must be signed in to change notification settings - Fork 32
111 lines (96 loc) · 3.34 KB
/
release.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
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
110
111
# This is a basic workflow to help you get started with Actions
name: Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: ["master"]
env:
PARALLELISM: 3
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "release"
release:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Go Report Card
uses: creekorful/[email protected]
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
id: checkout
uses: actions/checkout@v2
with:
# Fetch all versions for tag/changelog generation
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23.4
- name: Install promu
id: make_promu
run: |
make promu
- name: Calculate Version
id: calculate_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Update Version
id: update_version
env:
NEW_VERSION: ${{ steps.calculate_version.outputs.new_version }}
run: |
echo "${NEW_VERSION}" > VERSION
- name: Update Changelog
id: update_changelog
env:
CHANGELOG: ${{ steps.calculate_version.outputs.changelog }}
run: |
mv CHANGELOG.md _CHANGELOG.md || touch _CHANGELOG.md
echo "${CHANGELOG}" > CHANGELOG.md
cat _CHANGELOG.md >> CHANGELOG.md
rm -f _CHANGELOG.md
- name: Commit Changes
id: commit_changes
uses: EndBug/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
add: VERSION CHANGELOG.md
message: |
chore(build): Releasing ${{ steps.calculate_version.outputs.new_tag }}
- name: Commit Tag
id: commit_tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_sha: ${{ steps.commit_changes.outputs.commit_long_sha }}
- name: Build
id: build
run: |
promu crossbuild --parallelism $PARALLELISM
promu crossbuild --parallelism $PARALLELISM tarballs
promu checksum .tarballs
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.calculate_version.outputs.new_tag }}
release_name: Release ${{ steps.calculate_version.outputs.new_tag }}
body: |
Changes in this release:
${{ steps.calculate_version.outputs.changelog }}
draft: false
prerelease: false
- name: Upload Release Assets
id: upload_release_assets
uses: AButler/[email protected]
with:
files: ".tarballs/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.calculate_version.outputs.new_tag }}