Publish #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |