-
Notifications
You must be signed in to change notification settings - Fork 0
Move to local version of release system #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
efee650
fix(release): move to local version of release system
The0mikkel 06fe5f1
fix(release): improve logging and error handling in semantic-release …
The0mikkel 3b9869e
Correct typo in job name for semantic-release
The0mikkel cf30e17
Correct output description and fix semantic-release typo in dependencies
The0mikkel 0370074
Update .github/workflows/release.yml
The0mikkel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,17 +24,99 @@ on: | |||||||
| outputs: | ||||||||
| version: | ||||||||
| description: "The version of the release. Will be null if no release was made." | ||||||||
| value: ${{ jobs.release.outputs.version }} | ||||||||
| value: ${{ jobs.semantic-realease.outputs.version }} | ||||||||
|
The0mikkel marked this conversation as resolved.
Outdated
|
||||||||
|
|
||||||||
| jobs: | ||||||||
| release: | ||||||||
| semantic-realease: | ||||||||
|
The0mikkel marked this conversation as resolved.
Outdated
|
||||||||
| name: Semantic release | ||||||||
| runs-on: ubuntu-latest | ||||||||
| environment: ${{ inputs.ENVIRONMENT || '' }} | ||||||||
| permissions: | ||||||||
| contents: write | ||||||||
| packages: write | ||||||||
| id-token: write | ||||||||
| name: Release | ||||||||
| if: github.repository == ( inputs.repository || 'ctfpilot/ci') | ||||||||
| uses: the0mikkel/ci/.github/workflows/semver-release-standalone.yml@v1.4.1 | ||||||||
| secrets: inherit | ||||||||
| with: | ||||||||
| ENVIRONMENT: ${{ inputs.ENVIRONMENT }} | ||||||||
| outputs: | ||||||||
| version: ${{ steps.version.outputs.version }} | ||||||||
| steps: | ||||||||
| - name: Checkout | ||||||||
| uses: actions/checkout@v4 | ||||||||
| with: | ||||||||
| fetch-depth: 0 | ||||||||
| persist-credentials: false | ||||||||
| - name: Setup Node.js | ||||||||
| uses: actions/setup-node@v6 | ||||||||
| with: | ||||||||
| node-version: "lts/*" | ||||||||
| - name: Install dependencies | ||||||||
| run: npm install @semantic-release/exec @semantic-release/commit-analyzer @semantic-release/git @semantic-release/github @semantic-release/release-notes-generator conventional-changelog-conventionalcommits -D | ||||||||
|
The0mikkel marked this conversation as resolved.
Outdated
|
||||||||
| - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies | ||||||||
| run: npm audit signatures | ||||||||
| - name: Detect if configuration file is available for semantic-release | ||||||||
| id: check-config | ||||||||
| run: | | ||||||||
| if [ -f .releaserc.json ] || [ -f .releaserc ] || [ -f release.config.js ]; then | ||||||||
| echo "config_exists=true" >> $GITHUB_OUTPUT | ||||||||
| else | ||||||||
| echo "config_exists=false" >> $GITHUB_OUTPUT | ||||||||
| fi | ||||||||
| - name: Set default configuration file for semantic-release | ||||||||
| if: steps.check-config.outputs.config_exists == 'false' | ||||||||
| run: | | ||||||||
| cat << 'EOF' > .releaserc.json | ||||||||
| { | ||||||||
| "branches": [ | ||||||||
| "main", | ||||||||
| { | ||||||||
| "name": "develop", | ||||||||
| "prerelease": "r" | ||||||||
| } | ||||||||
| ], | ||||||||
| "plugins": [ | ||||||||
| [ | ||||||||
| "@semantic-release/commit-analyzer", | ||||||||
| { | ||||||||
| "preset": "conventionalcommits" | ||||||||
| } | ||||||||
| ], | ||||||||
| [ | ||||||||
| "@semantic-release/release-notes-generator", | ||||||||
| { | ||||||||
| "preset": "conventionalcommits" | ||||||||
| } | ||||||||
| ], | ||||||||
| [ | ||||||||
| "@semantic-release/github", | ||||||||
| { | ||||||||
| "successComment": false | ||||||||
| } | ||||||||
| ], | ||||||||
| [ | ||||||||
| "@semantic-release/exec", | ||||||||
| { | ||||||||
| "prepareCmd": "echo ${nextRelease.version} > version.txt", | ||||||||
| "publishCmd": "echo 'Published version ${nextRelease.version}'" | ||||||||
| } | ||||||||
| ], | ||||||||
| [ | ||||||||
| "@semantic-release/git", | ||||||||
| { | ||||||||
| "assets": [], | ||||||||
| "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||||||||
| } | ||||||||
| ] | ||||||||
| ] | ||||||||
| } | ||||||||
| EOF | ||||||||
| - name: Release | ||||||||
| env: | ||||||||
| GITHUB_TOKEN: ${{ secrets.RELEASE_GH_TOKEN || secrets.GITHUB_TOKEN }} | ||||||||
| NPM_TOKEN: ${{ secrets.RELEASE_GH_TOKEN || secrets.GITHUB_TOKEN }} | ||||||||
| run: npx semantic-release 2>&1 semantic-release.log | ||||||||
|
The0mikkel marked this conversation as resolved.
Outdated
|
||||||||
| - name: Archive release log | ||||||||
|
||||||||
| - name: Archive release log | |
| - name: Archive release log | |
| if: always() |
The0mikkel marked this conversation as resolved.
Outdated
The0mikkel marked this conversation as resolved.
Outdated
The0mikkel marked this conversation as resolved.
Outdated
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.