-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (47 loc) · 1.59 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
name: Release
on:
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows.
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out VCS repository
uses: actions/checkout@v3
- name: Build and test all Bazel targets
uses: ./.github/actions/build-test
# Work around lack of the annotated tag for the motivating tag
# being present unless we fetch at depth zero (meaning fetch all
# history, with no depth restriction).
#
# Pertinent issues and PRs:
# https://github.com/actions/checkout/issues/338
# https://github.com/actions/checkout/issues/448
# https://github.com/actions/checkout/issues/701
# https://github.com/actions/checkout/pull/579
#
# Basis of inspiration:
# https://github.com/actions/checkout/issues/701#issuecomment-1139627817
# https://stackoverflow.com/a/54635270
- name: Fetch annotated Git tag
run: |
git fetch origin \
--no-tags \
+refs/tags/${{ github.ref_name }}:refs/tags/${{ github.ref_name }}
- name: Prepare release notes and artifacts
run: |
gh_repository='${{ github.repository }}'
tag_name='${{ github.ref_name }}'
.github/workflows/prepare-release \
"${gh_repository#*/}" \
"${tag_name}" \
> release-notes.txt
- name: Issue release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
body_path: release-notes.txt
files: vcs-archive-*.tar.gz
fail_on_unmatched_files: true