Skip to content

Commit cee3918

Browse files
committed
add a temporary release.yml workflow
1 parent f5bb1d6 commit cee3918

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Read version info
17+
run: |
18+
echo "GO_VERSION=$(cat go.version)" >> $GITHUB_ENV
19+
echo "ESBUILD_VERSION=$(cat version.txt)" >> $GITHUB_ENV
20+
21+
- name: Extract the release notes
22+
run: |
23+
CHANGELOG=$(awk -v "ver=$ESBUILD_VERSION" '/^## / { if (p) { exit }; if ($2 == ver) { p=1; next} } p' CHANGELOG.md)
24+
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
25+
echo "$CHANGELOG" >> $GITHUB_ENV
26+
echo "EOF" >> $GITHUB_ENV
27+
28+
# Make sure we'll be able to generate release notes later on below
29+
- name: Release notes must not be empty
30+
run: |
31+
test -n "$CHANGELOG"
32+
33+
# Only do this after publishing was successful
34+
- name: Create a GitHub Release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: v${{ env.ESBUILD_VERSION }}
40+
release_name: v${{ env.ESBUILD_VERSION }}
41+
body: ${{ env.CHANGELOG }}
42+
draft: false
43+
prerelease: false

0 commit comments

Comments
 (0)