Skip to content

Commit

Permalink
Update release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
mizaki authored Sep 18, 2024
1 parent 6f2483b commit 76e8f9f
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@ on:

jobs:
build-and-publish:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
strategy:
matrix:
python_version: ['3.9']
os: [ubuntu-latest]

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

- name: Set up Python 3.9
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: ${{ matrix.python_version }}


- name: Install build dependencies
run: |
Expand All @@ -32,24 +37,15 @@ jobs:
- name: Build and install wheel
run: |
tox run -m build
python -m pip install dist/*.whl
- name: "Publish distribution 📦 to PyPI"
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1

- name: Get release name
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* # github is dumb
echo "release_name=$(git tag -l --format "%(refname:strip=2): %(contents:lines=1)" ${{ github.ref_name }})" >> $GITHUB_ENV
python -m pip install dist/*.whl -t build
cd build
zip -x "*/__pycache__/*" -r ../dist/${{ github.event.repository.name }}.zip *
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: "${{ env.release_name }}"
draft: false
files: |
dist/*.whl
dist/*.zip

0 comments on commit 76e8f9f

Please sign in to comment.