mirror of
https://github.com/Picocrypt/CLI.git
synced 2026-03-11 14:44:23 +00:00
Create build.yml
This commit is contained in:
parent
d6504d6040
commit
50f671a96f
1 changed files with 60 additions and 0 deletions
60
.github/workflows/build.yml
vendored
Normal file
60
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
name: build
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "VERSION"
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>1.18'
|
||||
check-latest: true
|
||||
cache: false
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd src
|
||||
go mod download
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cd src
|
||||
GOOS=windows GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-windows-amd64.exe Picocrypt.go
|
||||
GOOS=windows GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-windows-arm64.exe Picocrypt.go
|
||||
GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-macos-amd64 Picocrypt.go
|
||||
GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-macos-arm64 Picocrypt.go
|
||||
GOOS=linux GOARCH=amd64 go build -v -ldflags="-s -w" -o picocrypt-linux-amd64 Picocrypt.go
|
||||
GOOS=linux GOARCH=arm64 go build -v -ldflags="-s -w" -o picocrypt-linux-arm64 Picocrypt.go
|
||||
env:
|
||||
CGO_ENABLED: 1
|
||||
GOAMD64: v2
|
||||
|
||||
- name: Get version tag
|
||||
run: |
|
||||
VERSION=$(cat VERSION)
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
picocrypt-windows-amd64.exe
|
||||
picocrypt-windows-arm64.exe
|
||||
picocrypt-macos-amd64
|
||||
picocrypt-macos-arm64
|
||||
picocrypt-linux-amd64
|
||||
picocrypt-linux-arm64
|
||||
tag_name: ${{ env.VERSION }}
|
||||
make_latest: true
|
||||
Loading…
Reference in a new issue