Skip to content

Commit

Permalink
ci: Fix release workflow for GitHub Actions. (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Sep 14, 2023
1 parent 92924ce commit cc12484
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 32 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/release.yml
Expand Up @@ -16,20 +16,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
TWINE_USERNAME: ${{ vars.TWINE_USERNAME }}
run: make upload
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: git-changelog --release-notes > release-notes.md
- 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:
pages-build-with-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -43,12 +30,18 @@ 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
with:
body_path: release-notes.md
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') }}
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: pages-build
needs: pages-build-with-release
permissions:
pages: write
id-token: write
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Expand Up @@ -140,7 +140,11 @@ changelog:
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
fi
$(PIPRUN) git-changelog -ETrio docs/changelog.md -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
$(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

# Generate release notes from changelog.
release-notes:
$(PIPRUN) git-changelog --input $(CHANGELOG_PATH) --release-notes

# Build documentation only from src.
docs-gen:
Expand Down
6 changes: 5 additions & 1 deletion template/Makefile.jinja
Expand Up @@ -143,7 +143,11 @@ changelog:
echo "Existing Changelog found at '$(CHANGELOG_URL)', download for incremental generation."; \
wget -q -O $(CHANGELOG_PATH) $(CHANGELOG_URL); \
fi
$(PIPRUN) git-changelog -ETrio docs/changelog.md -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test
$(PIPRUN) git-changelog -ETrio $(CHANGELOG_PATH) -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

# Generate release notes from changelog.
release-notes:
$(PIPRUN) git-changelog --input $(CHANGELOG_PATH) --release-notes

# Build documentation only from src.
docs-gen:
Expand Down
Expand Up @@ -16,20 +16,7 @@ jobs:
TWINE_PASSWORD: {{ '${{ secrets.TWINE_PASSWORD }}' }}
TWINE_USERNAME: {{ '${{ vars.TWINE_USERNAME }}' }}
run: make upload
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Prepare release notes
run: git-changelog --release-notes > release-notes.md
- 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:
pages-build-with-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -43,12 +30,18 @@ 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
with:
body_path: release-notes.md
prerelease: {{ '${{ startsWith(github.ref, \'refs/tags/v0\') }}' }}
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: public
pages-deploy:
needs: pages-build
needs: pages-build-with-release
permissions:
pages: write
id-token: write
Expand Down

0 comments on commit cc12484

Please sign in to comment.