-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (34 loc) · 1.42 KB
/
release-cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Release Chemotion CLI
on:
push:
tags:
- "*"
jobs:
build-release-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: "go.mod"
- name: Build Go for all OSes
run: |
cp payload/docker-compose.yml .
cp payload/backup.sh .
go mod verify
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X github.com/${{ github.repository }}/cli.versionCLI=${{ github.ref_name }}" -o chemCLI
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-X github.com/${{ github.repository }}/cli.versionCLI=${{ github.ref_name }}" -o chemCLI.arm.osx
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-X github.com/${{ github.repository }}/cli.versionCLI=${{ github.ref_name }}" -o chemCLI.amd.osx
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-X github.com/${{ github.repository }}/cli.versionCLI=${{ github.ref_name }}" -o chemCLI.exe
- name: Release Binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
chemCLI
chemCLI.arm.osx
chemCLI.amd.osx
chemCLI.exe
docker-compose.yml
backup.sh
token: "${{ secrets.GITHUB_TOKEN }}"