Skip to content

Commit

Permalink
Initial release (#2)
Browse files Browse the repository at this point in the history
release to pypi
  • Loading branch information
leon1995 authored Mar 23, 2023
1 parent f004e49 commit f57e62a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"

jobs:
build:
publish:
permissions:
contents: write
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') # only publish on specific branches
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/publish.yml
secrets: inherit # pass all secrets

publish:
name: Publish
prerelease:
name: Prerelease
runs-on: ubuntu-latest
needs: build
needs: publish
permissions:
contents: write

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

- name: Download Artifact
uses: actions/download-artifact@v3
with:
Expand All @@ -31,5 +34,5 @@ jobs:
with:
files: |
dist/*.whl
prerelease: False
prerelease: True
body_path: CHANGELOG.md
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ on:
workflow_call:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
- "v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+"

jobs:
build:
permissions:
contents: write
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') # only publish on specific branches
uses: ./.github/workflows/build.yml

publish:
Expand All @@ -30,5 +29,4 @@ jobs:
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.PYPI_API_TOKEN }}
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
name: Release package

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
publish:
permissions:
contents: write
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v') # only publish on specific branches
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/publish.yml
secrets: inherit # pass all secrets

release:
name: Release
runs-on: ubuntu-latest
needs: build
needs: publish
permissions:
contents: write

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

- name: Download Artifact
uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit f57e62a

Please sign in to comment.