-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since we want to use 0.x.y versions for now, we modify the behavior via releaseRules, e.g. * breaking is set to minor release (by default it's major) * feat is set to patch (by default it's minor) Once we release v1.0.0 we should reset these to their intended behavior.
- Loading branch information
Showing
3 changed files
with
114 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Package and Release | ||
on: | ||
push: | ||
branches: | ||
- versioning-0 # TODO: use main | ||
permissions: | ||
contents: read # for checkout | ||
jobs: | ||
# TODO: uncomment this | ||
#lint-and-test: | ||
# uses: ./.github/workflows/lint-and-test.yml | ||
|
||
release: | ||
name: Publish Library | ||
runs-on: large-8-core-32gb-22-04 | ||
# needs: [lint-and-test] # TODO: uncomment this | ||
environment: deploy #!! DO NOT CHANGE THIS LINE !! # | ||
permissions: | ||
contents: write # to be able to publish a GitHub release | ||
issues: write # to be able to comment on released issues | ||
pull-requests: write # to be able to comment on released pull requests | ||
id-token: write # to enable use of OIDC for npm provenance | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # download tags, see https://github.com/actions/checkout/issues/100 | ||
- run: git config --global --add safe.directory $(realpath .) | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.x" | ||
- name: Semantic Release | ||
run: | | ||
npm install semantic-release | ||
npx semantic-release --dry-run # TODO: remove dry-run | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
#CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} #TODO: add CRATES_TOKEN |
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,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=${1?expected version as argument} | ||
echo Building $VERSION |
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,72 @@ | ||
{ | ||
"name": "proof_of_sql", | ||
"version": "0.0.0-development", | ||
"devDependencies": { | ||
"conventional-changelog-conventionalcommits": "^5.0.0", | ||
"semantic-release": "^21.0.5" | ||
}, | ||
"release": { | ||
"branches": [ | ||
"main" | ||
], | ||
"tagFormat": "v${version}", | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalCommits", | ||
"releaseRules": [ | ||
{ "breaking": true, "release": "minor" }, | ||
{ "revert": true, "release": "patch" }, | ||
{ "type": "feat", "release": "patch" }, | ||
{ "type": "fix", "release": "patch" }, | ||
{ "type": "build", "release": "patch" }, | ||
{ "type": "docs", "release": "patch" }, | ||
{ "type": "chore", "release": "patch" }, | ||
{ "type": "bench", "release": "patch" }, | ||
{ "type": "perf", "release": "patch" }, | ||
{ "type": "refactor", "release": "patch" }, | ||
{ "type": "test", "release": "patch" }, | ||
{ "type": "ci", "release": "patch" } | ||
], | ||
"parserOpts": { | ||
"noteKeywords": [ | ||
"BREAKING CHANGE", | ||
"BREAKING CHANGES", | ||
"BREAKING" | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "bash ./ci/build.sh ${nextRelease.version}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
{ | ||
"path": "dist/*.h" | ||
}, | ||
{ | ||
"path": "dist/*.so*" | ||
}, | ||
{ | ||
"path": "dist/*.zip" | ||
}, | ||
{ | ||
"path": "dist/*.tar.gz" | ||
} | ||
] | ||
} | ||
] | ||
] | ||
}, | ||
"dependencies": { | ||
"@semantic-release/exec": "^6.0.3" | ||
} | ||
} |