diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 397376f..6d856c4 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -18,3 +18,11 @@ jobs: uses: ./.github/workflows/go-test.yaml secrets: inherit + + checks-passed: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + name: "Checks Passed" + runs-on: ubuntu-latest + needs: [lint, build, test] + steps: + - run: echo "All required passed!" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml deleted file mode 100644 index c54f62f..0000000 --- a/.github/workflows/goreleaser.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Release - -on: - push: - tags: - - "*" - -permissions: - contents: write - -jobs: - goreleaser: - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: v1.1.0 - args: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a283848 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,35 @@ +name: Release +on: + workflow_run: + workflows: ["Go"] + branches: [main] + types: + - completed + +concurrency: + group: release-please-${{ github.ref }} + +jobs: + release-please: + name: Release Please + runs-on: ubuntu-latest + + if: github.event.workflow_run.conclusion == 'success' + + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + - uses: google-github-actions/release-please-action@v4 + + fail-release: + name: Fail Release + runs-on: ubuntu-latest + + if: github.event.workflow_run.conclusion == 'failure' + + steps: + - run: | + echo "::error ::Cannot release unless 'Go' workflow suceeds!" + exit 1 diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index 029d49a..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,5 +0,0 @@ -builds: -- skip: true - -release: - draft: true diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..5fdd883 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.1.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..1205527 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,16 @@ +{ + "packages": { + ".": { + "changelog-path": "CHANGELOG.md", + "release-type": "go", + "draft-pull-request": true + } + }, + "pull-request-title-pattern": "chore: 🔖 release${component} ${version}", + "separate-pull-requests": true, + "draft-pull-request": true, + "plugins": [ + "sentence-case" + ], + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +}