-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (32 loc) · 881 Bytes
/
Copy pathrelease.yml
File metadata and controls
39 lines (32 loc) · 881 Bytes
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: Release
# Trigger workflow only on semantic version tags
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout code
- uses: actions/checkout@v3
# Step 2: Setup Go
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
# Step 3: Run tests before releasing
- name: Run tests
run: go test ./...
# Step 4: Optional build (for libraries, mostly checks compile)
- name: Build
run: go build ./...
# Step 5: Create a draft GitHub release
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}