-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
181 additions
and
30 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
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,41 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
# we do not want more than one release workflow executing at the same time, ever | ||
concurrency: | ||
group: release | ||
# cancelling in the middle of a release would create incomplete releases | ||
# so cancel-in-progress is false | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: tibdex/github-app-token@v1 | ||
id: generate_token | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ steps.generate_token.outputs.token }} | ||
|
||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable-small | ||
|
||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ibis | ||
extraPullNames: nix-community,poetry2nix | ||
|
||
- name: run semantic-release | ||
run: ./ci/release/run.sh | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | ||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.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,36 @@ | ||
{ | ||
"branches": ["master"], | ||
"tagFormat": "${version}", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogTitle": "# Release Notes", | ||
"changelogFile": "docs/web/release_notes.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"verifyConditionsCmd": "ci/release/verify.sh", | ||
"prepareCmd": "ci/release/prepare.sh ${nextRelease.version}", | ||
"publishCmd": "ci/release/publish.sh" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": ["dist/*.whl"] | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["pyproject.toml", "docs/web/release_notes.md"], | ||
"message": "chore(release): ${nextRelease.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,40 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure -p git nodejs nix -i bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
curdir="$PWD" | ||
worktree="$(mktemp -d)" | ||
branch="$(basename "$worktree")" | ||
|
||
git worktree add "$worktree" | ||
|
||
function cleanup() { | ||
cd "$curdir" || exit 1 | ||
git worktree remove "$worktree" | ||
git worktree prune | ||
git branch -D "$branch" | ||
} | ||
|
||
trap cleanup EXIT ERR | ||
|
||
cd "$worktree" || exit 1 | ||
|
||
npx --yes \ | ||
-p semantic-release \ | ||
-p "@semantic-release/commit-analyzer" \ | ||
-p "@semantic-release/release-notes-generator" \ | ||
-p "@semantic-release/changelog" \ | ||
-p "@semantic-release/exec" \ | ||
-p "@semantic-release/git" \ | ||
semantic-release \ | ||
--ci \ | ||
--dry-run \ | ||
--plugins \ | ||
--analyze-commits "@semantic-release/commit-analyzer" \ | ||
--generate-notes "@semantic-release/release-notes-generator" \ | ||
--verify-conditions "@semantic-release/changelog,@semantic-release/exec,@semantic-release/git" \ | ||
--prepare "@semantic-release/changelog,@semantic-release/exec" \ | ||
--branches "$branch" \ | ||
--repository-url "file://$PWD" |
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 nix-shell | ||
#!nix-shell --pure -p poetry -i bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
# set version | ||
poetry version "$1" | ||
|
||
# build artifacts | ||
poetry build |
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,7 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell --pure --keep POETRY_PYPI_TOKEN_PYPI -p poetry -i bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
poetry publish |
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,15 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -p cacert poetry git nodejs nix -i bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
npx --yes \ | ||
-p semantic-release \ | ||
-p "@semantic-release/commit-analyzer" \ | ||
-p "@semantic-release/release-notes-generator" \ | ||
-p "@semantic-release/changelog" \ | ||
-p "@semantic-release/github" \ | ||
-p "@semantic-release/exec" \ | ||
-p "@semantic-release/git" \ | ||
semantic-release --ci |
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,15 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell --pure --keep POETRY_PYPI_TOKEN_PYPI -p poetry -p git -i bash | ||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
# verify TOML is sane | ||
poetry check | ||
|
||
# verify that the lock file is up to date | ||
poetry lock --no-update | ||
git diff --exit-code poetry.lock | ||
|
||
# verify that we have a token available to push to pypi using set -u | ||
: "${POETRY_PYPI_TOKEN_PYPI}" |
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 |
---|---|---|
@@ -1,3 +1 @@ | ||
# Release Notes | ||
|
||
<!--next-version-placeholder--> |
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