diff --git a/.github/scripts/github/make-release b/.github/scripts/github/make-release new file mode 100755 index 0000000000..89152bacbd --- /dev/null +++ b/.github/scripts/github/make-release @@ -0,0 +1,17 @@ +#!/bin/bash + +err() { + echo "$0: $*" +} + +[ "$GITHUB_REPOSITORY" ] || err "missing variable GITHUB_REPOSITORY" + +TITLE=$(git tag -l --format='%(contents)' $tag) + +echo "tag=$tag" +echo "title=$TITLE" + +gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="$tag" \ + --generate-notes diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..b1ce7c3390 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Publish release on github + +on: + push + +permissions: + contents: write + +jobs: + release: + name: Release pushed tag + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/xlibre-xserver-') }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: .github/scripts/github/make-release