Merge pull request #2 from Sancretor/feat/add-support-to-job-slice-count #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This uses an action (crazy-max/ghaction-import-gpg) that assumes you set your | |
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` | |
# secret. If you would rather own your own GPG handling, please fork this action | |
# or use an alternative one for key handling. | |
# | |
# You will need to pass the `--batch` flag to `gpg` in your signing step | |
# in `goreleaser` to indicate this is being used in a non-interactive mode. | |
# | |
name: Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
tags-ignore: | |
- '**' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
- name: Release | |
id: release | |
uses: cycjimmy/semantic-release-action@5982a02995853159735cb838992248c4f0f16166 # v2 | |
with: | |
semantic_version: 17.4.7 | |
branches: | | |
[ | |
'main' | |
] | |
extra_plugins: | | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
env: | |
GIT_CREDENTIALS: git:${{ secrets.PAT }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Go | |
if: steps.release.outputs.new_release_published == 'true' | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Import GPG key | |
if: steps.release.outputs.new_release_published == 'true' | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
# These secrets will need to be configured for the repository: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
- name: Run GoReleaser | |
if: steps.release.outputs.new_release_published == 'true' | |
uses: goreleaser/[email protected] | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
# GitHub sets this automatically | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |