Skip to content

Commit

Permalink
ci: Add release workflow for creating GitHub releases (#17)
Browse files Browse the repository at this point in the history
build artifacts with hatch, create a draft release, and upload the files. Run on every tag pushed to the main branch matching the semver pattern 'v*.*.*'.
  • Loading branch information
Olaf-Wolf3D authored May 14, 2024
1 parent 4996616 commit e7329e8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release
on:
push:
tags:
- 'v*.*.*'
branches:
- main

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install hatch
run: pip install hatch

- name: Build artifacts
run: hatch build

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
files: |
./dist/*.whl
./dist/*.tar.gz
name: ${{ github.repository_owner }}/${{ github.repository }} ${{ github.ref }}
draft: true
prerelease: ${{ contains(github.ref, '-') }}
generate_release_notes: true
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Source = "https://github.com/readyplayerme/meshops"
[tool.hatch.version]
path = "src/readyplayerme/meshops/__about__.py"

[tool.hatch.build.targets.wheel]
[tool.hatch.build]
sources = ["src"]
packages = ["src/readyplayerme"]

[tool.hatch.envs.default]
Expand Down

0 comments on commit e7329e8

Please sign in to comment.