From d598e35ed2c155b18becaeb6dc6b64e092a7b09b Mon Sep 17 00:00:00 2001 From: Shubham Hibare Date: Sat, 23 Dec 2023 12:45:31 +0530 Subject: [PATCH] chore(wf): switch to composite wf --- .github/workflows/goreleaser.yml | 29 -------------------- .github/workflows/test-build-publish.yml | 34 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 29 deletions(-) delete mode 100644 .github/workflows/goreleaser.yml create mode 100644 .github/workflows/test-build-publish.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml deleted file mode 100644 index 385cfe2..0000000 --- a/.github/workflows/goreleaser.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: goreleaser - -on: - push: - tags: - - "*" -jobs: - release: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.20.1 - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FURY_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }} diff --git a/.github/workflows/test-build-publish.yml b/.github/workflows/test-build-publish.yml new file mode 100644 index 0000000..5c6914d --- /dev/null +++ b/.github/workflows/test-build-publish.yml @@ -0,0 +1,34 @@ +name: Test, Build & Publish + +on: + push: + tags: + - "v*" + pull_request: + branches: + - "main" + - "dev" + paths-ignore: + - "**/README.md" + - "**/.github" + - "**/.vscode" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + +jobs: + test-build-publish: + permissions: + contents: write + id-token: write + runs-on: ubuntu-latest + steps: + - name: Goreleaser + uses: hibare/.github/github/shared-workflows/goreleaser@0962b9d76360405b3c4bf78f91424b7905bb03a8 # v0.3.0 + with: + args: ${{ github.event_name == 'pull_request' && 'build --snapshot --clean' || 'release --clean' }} + sign: ${{ github.event_name != 'pull_request' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FURY_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }} \ No newline at end of file