-
Notifications
You must be signed in to change notification settings - Fork 31
48 lines (41 loc) · 1.51 KB
/
Copy pathrelease.yml
File metadata and controls
48 lines (41 loc) · 1.51 KB
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
name: Release
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run tests
run: go test -v -race ./...
- name: Create release
uses: googleapis/release-please-action@v4
id: release
with:
release-type: go
package-name: gotree
token: ${{ secrets.GITHUB_TOKEN }}
- name: Tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git tag -d v${{ steps.release.outputs.major }} 2>/dev/null || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} 2>/dev/null || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }} --force
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} --force