From 714673b66537da528c6e4ebd751fa7e60292fdf6 Mon Sep 17 00:00:00 2001 From: Yusuke Tsutsumi Date: Sat, 2 Nov 2024 13:16:19 -0700 Subject: [PATCH] chore: add release workflow prepare for regular github releases. --- .github/workflows/go-test.yml | 2 +- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ docs/development.md | 5 ++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 docs/development.md diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 191e638..d3a5d61 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -1,4 +1,4 @@ -name: Go Tests +name: tests on: push: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6303b53 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: release + +on: + release: + types: [published] + +jobs: + build: + name: Build Release Binaries + runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: linux + arch: amd64 + artifact_name: aepcli-linux-amd64 + - os: darwin + arch: amd64 + artifact_name: aepcli-darwin-amd64 + - os: darwin + arch: arm64 + artifact_name: aepcli-darwin-arm64 + - os: windows + arch: amd64 + artifact_name: aepcli-windows-amd64.exe + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.21" + + - name: Build binary + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + run: | + go build -o ${{ matrix.artifact_name }} ./cmd/aepcli + + - name: Upload Release Asset + uses: softprops/action-gh-release@v1 + with: + files: ${{ matrix.artifact_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/development.md b/docs/development.md new file mode 100644 index 0000000..ac5d4d2 --- /dev/null +++ b/docs/development.md @@ -0,0 +1,5 @@ +# Development Guide + +## Release + +To release a new version of aepcli create a github release that uses semantic versioning. A workflow will be triggered to build the binaries and upload them to the release.