ente/.github/workflows/cli-release.yml

55 lines
1.8 KiB
YAML
Raw Normal View History

2024-03-05 07:17:57 +00:00
name: "Release (cli)"
on:
push:
# Run when a tag matching the pattern "cli-v*"" is pushed
#
# Tip: to test this workflow, push at tag with a pre-release version,
# e.g. `cli-v1.2.3-test`, where 1.2.3 is the expected version number of
# the next release that'll go out.
2024-03-05 14:07:51 +00:00
#
# See: [Note: Testing release workflows that are triggered by tags]
2024-03-05 07:17:57 +00:00
tags:
- "cli-v*"
jobs:
2024-03-05 10:31:31 +00:00
draft-release:
2024-03-05 07:17:57 +00:00
runs-on: ubuntu-latest
steps:
2024-03-05 09:07:57 +00:00
- name: Create a draft GitHub release
uses: ncipollo/release-action@v1
with:
draft: true
2024-03-05 10:31:31 +00:00
build:
runs-on: ubuntu-latest
needs: draft-release
strategy:
matrix:
goos: [linux, windows, darwin]
2024-03-05 10:33:14 +00:00
goarch: ["386", amd64, arm64]
2024-03-05 10:31:31 +00:00
exclude:
2024-03-05 10:33:14 +00:00
- goarch: "386"
goos: darwin
2024-03-05 10:31:31 +00:00
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build binaries and add to the release
2024-03-05 09:00:16 +00:00
uses: wangyoucao577/go-release-action@v1
2024-03-05 07:17:57 +00:00
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2024-03-05 10:31:31 +00:00
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
asset_name: ente-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}
release_name: ${{ github.ref_name }}
goversion: "1.20"
project_path: "./cli"
pre_command: export CGO_ENABLED=0
build_flags: "-trimpath"
ldflags: "-X main.AppVersion=${{ github.ref_name }} -s -w"
2024-03-05 10:37:30 +00:00
md5sum: false
sha256sum: true