Skip to content

Commit

Permalink
ci: Fix release workflow for GitHub Actions. (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored Sep 14, 2023
1 parent cc12484 commit 0c311e9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 15 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
jobs:
package:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -16,7 +17,28 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ vars.TWINE_USERNAME }}
run: make upload
pages-build-with-release:
release:
needs: pages-build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download changelog
uses: actions/download-artifact@v3
with:
name: changelog
path: docs/changelog.md
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: make release-notes
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: release-notes.md
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }}
pages-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -30,18 +52,17 @@ jobs:
- run: env | sort
- run: make dev-docs
- run: make docs
- run: make release-notes > release-notes.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
- name: Upload changelog
uses: actions/upload-artifact@v3
with:
body_path: release-notes.md
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }}
name: changelog
path: docs/changelog.md
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: pages-build-with-release
needs: release
permissions:
pages: write
id-token: write
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
jobs:
package:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -16,7 +17,28 @@ jobs:
TWINE_PASSWORD: {{ '${{ secrets.TWINE_PASSWORD }}' }}
TWINE_USERNAME: {{ '${{ vars.TWINE_USERNAME }}' }}
run: make upload
pages-build-with-release:
release:
needs: pages-build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download changelog
uses: actions/download-artifact@v3
with:
name: changelog
path: docs/changelog.md
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: make release-notes
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: release-notes.md
prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }}
pages-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,22 +48,21 @@ jobs:
uses: actions/setup-python@v4
with:
cache: pip
python-version: '3.11'
python-version: '{{ default_py }}'
- run: env | sort
- run: make dev-docs
- run: make docs
- run: make release-notes > release-notes.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
- name: Upload changelog
uses: actions/upload-artifact@v3
with:
body_path: release-notes.md
prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }}
name: changelog
path: docs/changelog.md
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: pages-build-with-release
needs: release
permissions:
pages: write
id-token: write
Expand Down

0 comments on commit 0c311e9

Please sign in to comment.