-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (54 loc) · 1.86 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (54 loc) · 1.86 KB
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
name: Release
# Each module of the workspace is released independently. Go's multi-module
# convention puts the module path in the tag:
#
# v1.2.3 -> the root module (github.com/hyperscale-stack/security)
# http/v1.2.3 -> the github.com/hyperscale-stack/security/http module
# oauth2/v1.2.3 -> the github.com/hyperscale-stack/security/oauth2 module
#
# Pushing such a tag validates the tagged state and publishes a GitHub
# release. Nothing is force-pushed and no tag is created by this workflow.
on:
push:
tags:
- "v*"
- "*/v*"
permissions:
contents: write
jobs:
release:
name: Release ${{ github.ref_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.x"
check-latest: true
- name: Resolve the released module
id: mod
run: |
tag='${{ github.ref_name }}'
case "$tag" in
*/v*) echo "dir=${tag%/v*}" >> "$GITHUB_OUTPUT" ;;
*) echo "dir=." >> "$GITHUB_OUTPUT" ;;
esac
- name: Workspace sync
run: make sync
# The whole workspace is built and tested so a tag can never publish a
# module whose dependencies (sibling modules) are in a broken state.
- name: Build all modules
run: make build
- name: Test all modules (race + coverage)
run: make test
- name: Publish GitHub release
uses: softprops/action-gh-release@v3
with:
name: ${{ github.ref_name }}
generate_release_notes: true
body: |
Release of the `${{ steps.mod.outputs.dir }}` module.
See [CHANGELOG.md](https://github.com/hyperscale-stack/security/blob/master/CHANGELOG.md)
for the consolidated history.