Skip to content

Commit

Permalink
update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
snail committed Oct 24, 2024
1 parent ff34de3 commit 08e9f7c
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI

on:
push:
# branches:
# - master
tags:
- 'v*.*.*'
release:
Expand All @@ -15,48 +13,43 @@ jobs:
strategy:
matrix:
arch: [amd64, arm64]
os: [linux, darwin, windows]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set variables
id: variables
run: |
tag=`basename ${{ github.ref }}`
golang_version=1.22
cgo_enabled=0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
go-version: ${{ steps.variables.outputs.golang_version }}

- name: Build binary
run: |
GOOS=${{ matrix.os }}
GOARCH=${{ matrix.arch }}
CGO_ENABLED=0
GOOS=linux go build -o bbx-${GOARCH}
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: bbx-${{ matrix.arch }}
path: bbx-${{ matrix.arch }}

# - name: Create GitHub Release
# uses: softprops/action-gh-release@v1
CGO_ENABLED=${{ steps.variables.outputs.cgo_enabled }}
go build -o bbx-${GOOS}-${GOARCH}
# - name: Upload binaries
# uses: actions/upload-artifact@v4
# with:
# # tag_name: v1.0.5
# files: |
# bbx-${{ matrix.arch }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# name: bbx-${{ matrix.arch }}
# path: bbx-${{ matrix.arch }}

- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.Run.outputs.current_tag }}
files: |
./bbx-${{ matrix.arch }}
- name: Generate release notes
uses: raulanatol/github-actions-releaser@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
./bbx-${{ matrix.os }}-${{ matrix.arch }}
release:
needs: build
Expand Down

0 comments on commit 08e9f7c

Please sign in to comment.