Skip to content

Commit

Permalink
Add release.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mystic-Mirage committed Jan 6, 2024
1 parent 892a056 commit 08e3b03
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release

on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Build project
run: poetry build

- uses: actions/upload-artifact@v3
with:
path: ./dist/

pypi-publish:
name: upload release to PyPI
needs:
- build

runs-on: ubuntu-latest
environment: publish

permissions:
id-token: write

steps:
- uses: actions/download-artifact@v3

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: ./artifact/
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Tests

on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main

permissions:
contents: read
Expand All @@ -26,7 +28,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v3

- name: Set up ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
# cache: poetry
Expand Down

0 comments on commit 08e3b03

Please sign in to comment.