From 19a873ba32a0fcbf26e1ca03aa8ad5117e16f55d Mon Sep 17 00:00:00 2001 From: saintedlama Date: Sun, 4 Oct 2026 08:18:17 +0200 Subject: [PATCH] chore(ci): add release.yml workflow with release-please --- .github/workflows/publish.yml | 76 ----------------------------------- .github/workflows/release.yml | 19 +++++++++ 2 files changed, 19 insertions(+), 76 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 44bdcbe..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: release-please - -on: - workflow_run: - workflows: ["CI"] - types: [completed] - branches: - - master - -permissions: - contents: write - issues: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - steps: - - uses: googleapis/release-please-action@v5 - id: release - with: - release-type: go - target-branch: master - - # Build cross-platform binaries and attach them to the GitHub release - # whenever release-please merges a Release PR and creates a new tag. - build-release-artifacts: - needs: release-please - if: ${{ needs.release-please.outputs.release_created }} - runs-on: ubuntu-latest - strategy: - matrix: - include: - - goos: linux - goarch: amd64 - suffix: "" - - goos: linux - goarch: arm64 - suffix: "" - - goos: darwin - goarch: amd64 - suffix: "" - - goos: darwin - goarch: arm64 - suffix: "" - - goos: windows - goarch: amd64 - suffix: ".exe" - steps: - - uses: actions/checkout@v7 - - - uses: actions/setup-go@v7 - with: - go-version-file: go.mod - cache: true - - - name: Build binary - env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - CGO_ENABLED: "0" - run: | - ARTIFACT="pcloud-cli_${{ matrix.goos }}_${{ matrix.goarch }}${{ matrix.suffix }}" - go build -trimpath -ldflags="-s -w" -o "${ARTIFACT}" . - echo "ARTIFACT=${ARTIFACT}" >> "$GITHUB_ENV" - - - name: Upload artifact to release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release upload "${{ needs.release-please.outputs.tag_name }}" \ - "${ARTIFACT}" --clobber diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ea11aac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release + +on: + push: + branches: [master] + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: go + target-branch: master