Skip to content

Commit

Permalink
build: added publish pipeline (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankanno authored Oct 26, 2024
1 parent 39ccefb commit 089e882
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Builds and uploads artifact
name: publish

on:
push:
branches:
- main
release:
types: [published]

env:
PYTHON_VERSION: 3.11
POETRY_VERSION: 1.8.4

jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
permissions:
contents: read

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry ${{ env.POETRY_VERSION }}
run: python -m pip install poetry==${{ env.POETRY_VERSION }}

- name: Set version with dunamai
uses: mtkennerly/dunamai-action@v1
id: version
with:
command: dunamai from git
args: --no-metadata --format "{base}" --pattern "(?P<base>\d\d\d\d\.\d\d\.\d\d)"

- run: echo ${{ steps.version.outputs.version }}
- run: poetry version ${{ steps.version.outputs.version }}

- name: poetry build
run: poetry build

- uses: actions/upload-artifact@v2
with:
name: poetry_build
path: dist/
22 changes: 22 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 089e882

Please sign in to comment.