-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Set exact tag for provider when make release (#139)
* allow manually release * fix
- Loading branch information
Showing
1 changed file
with
38 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,41 @@ permissions: | |
contents: write | ||
|
||
jobs: | ||
terraform-provider-release: | ||
uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/community.yml@v2 | ||
secrets: | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-private-key-passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | ||
with: | ||
setup-go-version-file: 'go.mod' | ||
git-ref: ${{ github.ref }} | ||
Release: | ||
runs-on: ubuntu-latest | ||
env: | ||
ACCESS_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | ||
with: | ||
ref: '${{ github.ref }}' | ||
fetch-depth: 0 | ||
|
||
- name: Set Tag as Environment Variable | ||
id: set_tag | ||
run: | | ||
echo "GORELEASER_CURRENT_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | ||
LAST_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) | ||
echo "GORELEASER_PREVIOUS_TAG=$LAST_TAG" >> $GITHUB_ENV | ||
- uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 | ||
with: | ||
go-version-file: go.mod | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | ||
- name: Setup Git token | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "StreamNative Bot" | ||
git config --global url."https://streamnativebot:${ACCESS_TOKEN}@github.com/".insteadOf "https://github.com/" | ||
- name: goreleaser release (without release notes) | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
args: release --clean --timeout 60m | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.SNBOT_GITHUB_TOKEN }} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |