Skip to content

Commit 3c39aa7

Browse files
committed
🐕 add action for release
1 parent 9c91351 commit 3c39aa7

2 files changed

Lines changed: 51 additions & 2 deletions

File tree

.github/workflows/go-release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Go Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build and Release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Set up Go
15+
uses: actions/setup-go@v4
16+
with:
17+
go-version: '1.23.6'
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Get the version
25+
id: version
26+
run: |
27+
VERSION=$(git describe --tags --abbrev=0)
28+
echo "::set-output name=tag_name::$VERSION"
29+
echo "VERSION=$VERSION" >> $GITHUB_ENV
30+
31+
- name: Change to golang directory
32+
run: cd golang
33+
34+
- name: Build
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
go install github.com/goreleaser/goreleaser@latest
39+
goreleaser release --clean
40+
41+
- name: Upload binaries to release
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ github.event.release.upload_url }}
47+
asset_path: ./dist/*
48+
asset_name: ${{ github.event.repository.name }}-${{ runner.os }}-${{ steps.version.outputs.tag_name }}.tar.gz # or zip
49+
asset_content_type: application/gzip # or application/zip

golang/.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ changelog:
3030
- '^test:'
3131
brews:
3232
- tap:
33-
owner: pranjalya # Your Github username
34-
name: homebrew-tap # The name of the tap
33+
owner: pranjalya
34+
name: homebrew-tap
3535
homepage: "https://github.com/pranjalya/subgit"
3636
description: "Downloads a subdirectory from a github repository"
3737
install: |

0 commit comments

Comments
 (0)