Skip to content

Commit

Permalink
test publish
Browse files Browse the repository at this point in the history
  • Loading branch information
SunsetWolf committed Jul 29, 2024
1 parent 60dd076 commit bd038d7
Showing 1 changed file with 24 additions and 36 deletions.
60 changes: 24 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,6 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install git-changelog using pipx
run: pipx install git-changelog
- name: Remove changelog to avoid file already exists error
run: rm -v docs/changelog.md
- name: Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
path: docs/
- name: Prepare release notes
run: make release-notes > release-notes.md
- id: prerelease
name: Determine prerelease
run: |
if [[ "${{ github.ref }}" =~ (a|b|rc)(0|[1-9][0-9]*)?$ ]]; then
echo "is_prerelease=true" > $GITHUB_OUTPUT
else
echo "is_prerelease=false" > $GITHUB_OUTPUT
fi
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
bump_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -47,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine bump2version
pip install setuptools wheel twine bump2version git-changelog
- name: Bump version
run: |
bump2version patch
Expand All @@ -59,19 +31,35 @@ jobs:
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git push --follow-tags
- name: Create GitHub Release
- name: Remove changelog to avoid file already exists error
run: rm -v docs/changelog.md
- name: Download changelog
uses: actions/download-artifact@v4
with:
name: changelog
path: docs/
- name: Prepare release notes
run: make release-notes > release-notes.md
- id: prerelease
name: Determine prerelease
run: |
if [[ "${{ github.ref }}" =~ (a|b|rc)(0|[1-9][0-9]*)?$ ]]; then
echo "is_prerelease=true" > $GITHUB_OUTPUT
else
echo "is_prerelease=false" > $GITHUB_OUTPUT
fi
- name: Create GitHub release
permissions:
contents: write
pull-requests: read
id: create_release
uses: actions/create-release@v1
contents: write
pull-requests: read
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.bump_version.outputs.new_version }}
release_name: Release ${{ steps.bump_version.outputs.new_version }}
draft: false
prerelease: false
body_path: release-notes.md
prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
package:
needs: release
runs-on: ubuntu-latest
Expand Down

0 comments on commit bd038d7

Please sign in to comment.