Skip to content

Commit 70c01b7

Browse files
committed
Add release workflow
1 parent bb52436 commit 70c01b7

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout source
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "1.23.10"
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "20"
30+
31+
- name: Extract version
32+
id: vars
33+
run: |
34+
VERSION=${GITHUB_REF_NAME#v}
35+
echo "VERSION=$VERSION" >> $GITHUB_ENV
36+
echo "version=$VERSION" >> $GITHUB_OUTPUT
37+
38+
- name: Download Go dependencies
39+
run: |
40+
mkdir -p go-mod
41+
GOMODCACHE="${PWD}/go-mod" go mod download -modcacherw -x
42+
43+
- name: Prebuild (JS & docs)
44+
run: make prebuild
45+
46+
- name: Create release tarball
47+
run: |
48+
tar -caf drasl-${VERSION}.tar.xz \
49+
--exclude='.git' \
50+
--transform="s|^|drasl-${VERSION}/|" *
51+
52+
- name: Upload release artifact
53+
uses: softprops/action-gh-release@v2
54+
with:
55+
files: drasl-${{ env.VERSION }}.tar.xz
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+

0 commit comments

Comments
 (0)