-
Notifications
You must be signed in to change notification settings - Fork 81
44 lines (40 loc) · 1.35 KB
/
publish.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
name: Publish
on:
release:
types: [published]
workflow_dispatch: # allows manual triggering
jobs:
webpage:
name: prepare release
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
- name: Create archive
id: archive
run: |
TAG="v0.20" # FIXME
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
env:
GITHUB_REF_NAME: 'v0.20' # FIXME
run: |
printf '\n-----\n\n' >> release_notes.txt
awk -f .github/workflows/changelog.awk CHANGELOG.md >> release_notes.txt
- name: Create draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: 'v0.20' # FIXME
run: |
gh release create --draft --notes-file release_notes.txt $TAG ${{ steps.archive.outputs.tgz }}