Skip to content

Commit

Permalink
Create a GitHub release on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Dec 4, 2024
1 parent b13ee8c commit a5f6973
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
on:
push:
branches: ["trunk"]
tags: ["v*"]
pull_request:
branches: ["trunk"]

Expand All @@ -24,6 +25,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/[email protected]
with:
Expand All @@ -46,12 +49,12 @@ jobs:
- run: "python -m tox"

build:
name: "build dist"

runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: apt install
run: |
Expand All @@ -78,3 +81,33 @@ jobs:
name: dist
path: dist/*.*
if-no-files-found: error

release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]

runs-on: ubuntu-24.04

permissions:
contents: write

steps:

- uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- run: |
set -x
tag="${TAG_REF:##*/}"
version=${tag:#v}
gh release create "$tag" \
--repo twm/yarrharr \
--verify-tag \
--title "Yarrharr $version" \
--generate-notes \
"dist/yarrharr-${version}.tar.gz" \
"dist/yarrharr-${version}"*.whl
env:
TAG_REF: "${{ github.ref }}"

0 comments on commit a5f6973

Please sign in to comment.