Skip to content

ci: Automate releases #643

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 4 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/pythonpublish.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/release-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release Dry Run

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Install Knope
uses: actions-rs/cargo@v1
with:
command: install
args: knope
- run: knope release --dry-run
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on: workflow_dispatch

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
git_push_gpgsign: false
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v1
- name: Install Knope
uses: actions-rs/cargo@v1
with:
command: install
args: knope
- name: Bump Version & Create GitHub Release
run: knope release
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
- name: Setup Poetry
run: |
python -m pip install --upgrade pip
pip install --upgrade poetry
poetry config http-basic.pypi __token__ ${{ secrets.PYPI_TOKEN }}
- name: Push to PyPI
run: poetry publish --build
16 changes: 16 additions & 0 deletions knope.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ name = "release"
type = "Command"
command = "npx prettier --write CHANGELOG.md"

[[workflows.steps]]
type = "Command"
command = "git add pyproject.toml CHANGELOG.md"

[[workflows.steps]]
type = "Command"
command = "git commit -m \"chore: Bump to version\""
variables = { "version" = "Version" }

[[workflows.steps]]
type = "Command"
command = "git push"

[[workflows.steps]]
type = "Release"

[github]
owner = "openapi-generators"
repo = "openapi-python-client"