-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: convert release to semantic-release
release-please error'd too often with "There are untagged, merged release PRs outstanding - aborting" and I couldn't get it to comply. Also see googleapis/release-please#1946. The new configuration for semantic-release should do everything we need, but I'm sure we will need another few rounds to fix the errors I don't see rn.
- Loading branch information
Showing
11 changed files
with
128 additions
and
196 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Check"] | ||
types: | ||
- completed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Init node | ||
uses: actions/setup-node@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
cache: false | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install UPX | ||
uses: crazy-max/ghaction-upx@v3 | ||
with: | ||
install-only: true | ||
- name: Install semantic-release and plugins globally | ||
run: | | ||
npm install -g semantic-release | ||
npm install -g semantic-release-replace-plugin | ||
npm install -g @semantic-release/exec | ||
npm install -g @semantic-release/changelog | ||
- name: Semantic release | ||
run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_USER: ${{ github.actor }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 file was deleted.
Oops, something went wrong.
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 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
|
||
cd client && go build -o pp | ||
# upx --best pp | ||
|
||
cd .. | ||
|
||
docker build -f api/src/main/docker/Dockerfile.distroless-test -t ghcr.io/sne11ius/pp-api:latest -t ghcr.io/sne11ius/pp-api:"$1" . | ||
docker push ghcr.io/sne11ius/pp-api --all-tags |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const releaseConfig = { | ||
branches: ['main'], | ||
plugins: [ | ||
'@semantic-release/commit-analyzer', | ||
'@semantic-release/release-notes-generator', | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"semantic-release-replace-plugin", | ||
{ | ||
"replacements": [ | ||
{ | ||
"files": ["client/root.go"], | ||
"from": "var version = \".*\"", | ||
"to": "var version = \"${nextRelease.version}\"", | ||
"results": [ | ||
{ | ||
"file": "client/root.go", | ||
"hasChanged": true, | ||
"numMatches": 1, | ||
"numReplacements": 1 | ||
} | ||
], | ||
"countMatches": true | ||
}, { | ||
"files": ["api/build.gradle.kts"], | ||
"from": "version = \".*\"", | ||
"to": "version = \"${nextRelease.version}\"", | ||
"results": [ | ||
{ | ||
"file": "client/root.go", | ||
"hasChanged": true, | ||
"numMatches": 1, | ||
"numReplacements": 1 | ||
} | ||
], | ||
"countMatches": true | ||
} | ||
] | ||
} | ||
], | ||
['@semantic-release/git', { | ||
'assets': [ | ||
'client/root.go', | ||
'api/build.gradle.kts', | ||
'CHANGELOG.md' | ||
], | ||
'message': 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' | ||
}], | ||
["@semantic-release/exec", { | ||
"verifyConditionsCmd": "./verify.sh", | ||
"publishCmd": "./publish.sh ${nextRelease.version}" | ||
}], | ||
'@semantic-release/github' | ||
] | ||
} | ||
|
||
module.exports = releaseConfig |