File: release.yml

package info (click to toggle)
pgq 3.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 808 kB
  • sloc: sql: 3,442; ansic: 2,013; python: 309; makefile: 84; sh: 1
file content (39 lines) | stat: -rw-r--r-- 1,222 bytes parent folder | download | duplicates (2)
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

name: REL

on:
  push:
    tags: ["v[0-9]*"]

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:

      - name: "Checkout code"
        uses: actions/checkout@v3

      - name: "Build tarball"
        run: |
          make checkver
          make dist
          EXTENSION=$(grep ^EXTENSION Makefile | sed 's/.*= *//')
          EXT_VERSION=$(grep ^EXT_VERSION Makefile | sed 's/.*= *//')
          test "${{github.ref}}" = "refs/tags/v${EXT_VERSION}" || { echo "ERR: tag mismatch"; exit 1; }
          echo "PACKAGE=${EXTENSION}" >> $GITHUB_ENV
          echo "VERSION=${EXT_VERSION}" >> $GITHUB_ENV
          echo "TGZ=${EXTENSION}-${EXT_VERSION}.tar.gz" >> $GITHUB_ENV
          echo "DRAFT=false" >> $GITHUB_ENV
          echo "PRERELEASE=false" >> $GITHUB_ENV

      - name: "Create Github release"
        env:
          GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
        run: |
          title="${PACKAGE} v${VERSION}"
          ghf="--notes-file=docs/notes/v${VERSION}.md"
          if test "${DRAFT}" = "true"; then ghf="${ghf} --draft"; fi
          if test "${PRERELEASE}" = "true"; then ghf="${ghf} --prerelease"; fi
          gh release create "v${VERSION}" "${TGZ}" --title="${title}" ${ghf}