Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto build and release #23

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 6 additions & 25 deletions .github/workflows/auto-realease.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
name: Deploy

name: Release

on:
push:
branches:
- main
tags:
- "v*.*.*"

jobs:
init:
name: 🚩 Initialize
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

release:
name: 🚀 Release
needs: init
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout code
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: lts/*

- name: Release
- name: Run GoReleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp .github/.releaserc.yml .
npm i -g semantic-release @semantic-release/changelog @semantic-release/git
semantic-release
curl -sL https://git.io/goreleaser | bash
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ go.work.sum
# env file
.env
.idea
# Added by goreleaser init:
dist/
68 changes: 68 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: 2

before:
hooks:
- go mod tidy

builds:
- id: "403unlockercli-linux" # Unique ID for this build
main: ./cmd/403unlockercli
binary: "403unlocker"
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64

- id: "403unlockercli-windows" # Unique ID for this build
main: ./cmd/403unlockercli
binary: "403unlocker"
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64

- id: "403unlockercli-darwin" # Unique ID for this build
main: ./cmd/403unlockercli
binary: "403unlocker"
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- arm64

archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
footer: >-

---

Released by [GoReleaser](https://github.com/goreleaser/goreleaser).