-
Notifications
You must be signed in to change notification settings - Fork 81
38 lines (34 loc) · 1.13 KB
/
prepare-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
name: Prepare release
on:
push:
tags:
- "v[0-9]*.[0-9]*"
jobs:
update-release-notes:
name: Update release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create archive
id: archive
run: |
TAG="${GITHUB_REF_NAME}"
REPOSITORY_NAME="${GITHUB_REPOSITORY#*/}"
PREFIX="${REPOSITORY_NAME}-${TAG:1}"
ARCHIVE="${PREFIX}.tar.gz"
echo "tgz=${ARCHIVE}" >> $GITHUB_OUTPUT
git archive --format=tar.gz --prefix="${PREFIX}/" -o "$ARCHIVE" "${TAG}"
- name: Prepare bzlmod / WORKSPACE snippets
run: .github/workflows/prepare_snippets.sh ${{ steps.archive.outputs.tgz }} > release_notes.txt
- name: Generate changelog
run: |
printf '\n-----\n\n' >> release_notes.txt
awk -f .github/workflows/changelog.awk CHANGELOG.md >> release_notes.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
body_path: release_notes.txt
fail_on_unmatched_files: true
files: ${{ steps.archive.outputs.tgz }}