-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f254de1
commit 59febc9
Showing
2 changed files
with
64 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ on: | |
branches: | ||
- main | ||
|
||
permissions: write-all | ||
permissions: read-all | ||
|
||
jobs: | ||
code-quality: | ||
|
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,63 @@ | ||
name: Create Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* # Triggers the workflow on version tags like v1.0.0 | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10 | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV | ||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-ansi | ||
|
||
- name: Build the package | ||
run: poetry build | ||
|
||
- name: Extract version | ||
id: get_version | ||
run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} # Use the tag that triggered the workflow | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Wheel Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/say_hello-${{ env.VERSION }}-py3-none-any.whl | ||
asset_name: say_hello-${{ env.VERSION }}-py3-none-any.whl | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Source Distribution Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/say_hello-${{ env.VERSION }}.tar.gz | ||
asset_name: say_hello-${{ env.VERSION }}.tar.gz | ||
asset_content_type: application/gzip |