Skip to content

Commit

Permalink
ci: add release process
Browse files Browse the repository at this point in the history
  • Loading branch information
derlin committed Mar 17, 2024
1 parent 600381b commit 7560451
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release Please
on:
push:
branches: [main]

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
# Necessary for release-please to create the
contents: write
pull-requests: write
outputs:
release_created: ${{ steps.rp.outputs.release_created }}
tag_name: ${{ steps.rp.outputs.tag_name }}
steps:
- uses: google-github-actions/release-please-action@v3
id: rp
with:
release-type: simple
changelog-types: '[{"type":"feat","section":"🚀 Features","hidden":false},{"type":"fix","section":"🐛 Bug Fixes","hidden":false},{"type":"docs","section":"💬 Documentation","hidden":false},{"type":"ci","section":"🦀 Build and CI","hidden":false}, {"type":"style","section":"🌈 Styling","hidden":false}]'
extra-files: build.gradle.kts

publish:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
permissions:
# Necessary for trusted publishing (pypi)
id-token: write
# Necessary for uploading assets to releases
contents: write

steps:
- name: Checkout tag ${{ needs.release-please.outputs.tag_name }}
uses: actions/checkout@v4
with:
#ref: 0.0.1
ref: ${{ needs.release-please.outputs.tag_name }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install package
run: pip install -e .[dev]

- name: Install make
run: sudo apt update && sudo apt -y --no-install-recommends install make

- name: Build
run: make build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true

- name: Add files to Release
uses: softprops/action-gh-release@v1
with:
#tag_name: 0.0.1
tag_name: ${{ needs.release-please.outputs.tag_name }}
files: |
dist/*.whl
dist/*.tar.gz
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

0 comments on commit 7560451

Please sign in to comment.