(cherry picked from commit 5d83b0d27a)
Signed-off-by: matttrach <matt.trachier@suse.com>
Co-authored-by: Matt Trachier <matt.trachier@suse.com>
This commit is contained in:
parent
376aab0bb2
commit
3ec02c3419
|
|
@ -11,32 +11,32 @@ jobs:
|
|||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
issues: write
|
||||
pull-requests: write
|
||||
actions: read
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: googleapis/release-please-action@c2a5a2bd6a758a0937f1ddb1e8950609867ed15c # v4.3.0 https://github.com/googleapis/release-please-action/commits/main/
|
||||
name: release-please
|
||||
id: release-please
|
||||
with:
|
||||
skip-github-pull-request: true
|
||||
skip-github-release: false
|
||||
config-file: release-please-config-rc.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 https://github.com/actions/checkout
|
||||
if: steps.release-please.outputs.version
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 https://github.com/actions/setup-go
|
||||
if: steps.release-please.outputs.version
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: true
|
||||
- name: Create and Push RC Tag with Git
|
||||
run: |
|
||||
BASE_VERSION=$(echo "$GITHUB_REF" | sed 's/refs\/heads\/release\///')
|
||||
echo "Base version is: $BASE_VERSION"
|
||||
git fetch --tags
|
||||
LATEST_RC_NUM=$(git tag | grep "^${BASE_VERSION}-rc." | sed 's/.*-rc.//' | sort -n | tail -1)
|
||||
if [ -z "$LATEST_RC_NUM" ]; then
|
||||
NEXT_RC_NUM=0
|
||||
else
|
||||
NEXT_RC_NUM=$((LATEST_RC_NUM + 1))
|
||||
fi
|
||||
NEXT_RC_TAG="${BASE_VERSION}-rc.${NEXT_RC_NUM}"
|
||||
echo "Calculated next RC tag: $NEXT_RC_TAG"
|
||||
|
||||
# Configure git user
|
||||
git config user.name "${{ github.actor }}"
|
||||
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||
|
||||
# Create and push the new tag
|
||||
git tag "$NEXT_RC_TAG" -m "Release Candidate $NEXT_RC_TAG"
|
||||
git push origin "$NEXT_RC_TAG"
|
||||
- name: retrieve GPG Credentials
|
||||
if: steps.release-please.outputs.version
|
||||
uses: rancher-eio/read-vault-secrets@main
|
||||
with:
|
||||
secrets: |
|
||||
|
|
@ -44,7 +44,6 @@ jobs:
|
|||
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKeyId | GPG_KEY_ID ;
|
||||
secret/data/github/repo/${{ github.repository }}/signing/gpg privateKey | GPG_KEY
|
||||
- name: import_gpg_key
|
||||
if: steps.release-please.outputs.version
|
||||
env:
|
||||
GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
||||
GPG_KEY_ID: ${{ env.GPG_KEY_ID }}
|
||||
|
|
@ -64,8 +63,7 @@ jobs:
|
|||
echo "Importing gpg key"
|
||||
echo "${GPG_KEY}" | gpg --import --batch > /dev/null || { echo "Failed to import GPG key"; exit 1; }
|
||||
- name: Run GoReleaser
|
||||
if: steps.release-please.outputs.version
|
||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
|
||||
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 https://github.com/goreleaser/goreleaser-action
|
||||
with:
|
||||
args: release --clean
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -54,8 +54,6 @@ release:
|
|||
extra_files:
|
||||
- glob: 'terraform-registry-manifest.json'
|
||||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
|
||||
# If you want to manually examine the release before its live, uncomment this line:
|
||||
# draft: true
|
||||
prerelease: false
|
||||
prerelease: auto
|
||||
changelog:
|
||||
disable: true
|
||||
|
|
|
|||
|
|
@ -16,3 +16,4 @@ assignees
|
|||
backport
|
||||
url
|
||||
gpg
|
||||
rc
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"packages": {
|
||||
".": {
|
||||
"release-type": "go",
|
||||
"prerelease": true,
|
||||
"include-v-in-tag": true,
|
||||
"include-component-in-tag": false,
|
||||
"always-update": true,
|
||||
"skip-changelog": true,
|
||||
"versioning": "prerelease"
|
||||
}
|
||||
},
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
|
||||
}
|
||||
Loading…
Reference in New Issue