Skip to content

Commit

Permalink
feat: release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
edulop91 committed Aug 3, 2022
1 parent b9c1296 commit ee2ec33
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
push:
branches:
- main

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v5
id: configure-changelog
with:
result-encoding: string
script: |
const changelogTypes = [
{type: "feat", section: "Features", hidden: false},
{type: "chore", section: "Misc", hidden: false},
{type: "fix", section: "BugFixes", hidden: false},
]
return JSON.stringify(changelogTypes)
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# For why we need to generate a token and not use the default
- name: Generate token
id: generate_token
uses: chanzuckerberg/[email protected]
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}

- name: release please
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: simple
bump-minor-pre-major: true
changelog-types: ${{ steps.configure-changelog.outputs.result }}
token: ${{ steps.generate_token.outputs.token }}

- uses: actions/checkout@v2
# we need to fetch all history and tags,
# so we build the proper version
with:
fetch-depth: 0
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-go@v2
with:
go-version: 1.18
if: ${{ steps.release.outputs.release_created }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
if: ${{ steps.release.outputs.release_created }}
outputs:
release_created: ${{ steps.release.outputs.release_created }}

0 comments on commit ee2ec33

Please sign in to comment.