Skip to content

Commit

Permalink
chore: trying to fix release.yml issues (#8)
Browse files Browse the repository at this point in the history
* chore: trying to fix reseal.yml issues

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
mdtanker and pre-commit-ci[bot] committed Nov 22, 2023
1 parent 612b319 commit aa8760a
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
types:
- published

permissions:
contents: read
id-token: write

jobs:
# job to determine appropriate version number, update changelog, and create a release commit
# release:
Expand All @@ -29,29 +33,56 @@ jobs:
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}

# job to build and inspect the package
dist:
# Always build & lint package.
build-package:
name: Build & verify package
runs-on: ubuntu-latest

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

- uses: hynek/build-and-inspect-python-package@v1

# job to publish the new version to pypi
publish:
needs: [dist]
environment: pypi
permissions:
id-token: write
# Upload to Test PyPI on every commit on main.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
environment: release-test-pypi
if:
github.repository_owner == 'python-attrs' && github.event_name == 'push'
&& github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build-package

steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

# Upload to real PyPI on GitHub Releases.
release-pypi:
name: Publish released package to pypi.org
environment: release-pypi
if:
github.repository_owner == 'python-attrs' && github.event.action ==
'published'
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
needs: build-package

steps:
- uses: actions/download-artifact@v3
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v3
with:
name: artifact
name: Packages
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit aa8760a

Please sign in to comment.