Skip to content

Commit

Permalink
github actions 整理
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Oct 11, 2023
1 parent e99663e commit 694fac6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go Build & Test
name: ci

on:
push:
Expand All @@ -8,8 +8,7 @@ on:
- "*"

jobs:
build:
name: build
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
40 changes: 19 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
name: Release Build
name: release

on:
push:
tags:
- '*'
- "*"

jobs:

build:
name: build
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
# go-version-file: ./go.mod
go-version: "^1.21.3"
- name: Set up Go
uses: actions/setup-go@v4
with:
# go-version-file: ./go.mod
go-version: "^1.21.3"

- run: go install github.com/tcnksm/ghr@latest
- run: go install github.com/tcnksm/ghr@latest

- name: Build
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/suzu_linux_amd64 cmd/suzu/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/suzu_darwin_amd64 cmd/suzu/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/suzu_darwin_arm64 cmd/suzu/main.go
gzip dist/*
- name: Build
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/suzu_linux_amd64 cmd/suzu/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/suzu_darwin_amd64 cmd/suzu/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o dist/suzu_darwin_arm64 cmd/suzu/main.go
gzip dist/*
- name: Release
run: |
ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace "${GITHUB_REF##*/}" dist/
- name: Release
run: |
ghr -t "${{ secrets.GITHUB_TOKEN }}" -u "${{ github.repository_owner }}" -r "suzu" --replace "${GITHUB_REF##*/}" dist/

0 comments on commit 694fac6

Please sign in to comment.