-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (44 loc) · 1.44 KB
/
release.yml
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
45
46
47
48
49
50
51
name: REL
on:
push:
tags: ["v[0-9]*"]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v2
- name: Build tarball
id: build
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 "EXTENSION=${EXTENSION}" >> $GITHUB_ENV
echo "EXT_VERSION=${EXT_VERSION}" >> $GITHUB_ENV
echo "TGZ=${EXTENSION}-${EXT_VERSION}.tar.gz" >> $GITHUB_ENV
- name: Create release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
release_name: ${{github.event.repository.name}} v${{env.EXT_VERSION}}
body_path: docs/notes/v${{env.EXT_VERSION}}.md
draft: false
prerelease: false
- name: Upload source
id: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.release.outputs.upload_url}}
asset_path: ${{env.TGZ}}
asset_name: ${{env.TGZ}}
asset_content_type: application/x-gzip