-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from gsinghjay/test/verify-workflows
ci: standardize Poetry usage across workflows
- Loading branch information
Showing
4 changed files
with
30 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,15 +30,13 @@ permissions: | |
id-token: write | ||
|
||
jobs: | ||
# Call the lint workflow first | ||
lint: | ||
name: Lint Check | ||
uses: ./.github/workflows/lint.yml | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
# Call the test workflow next | ||
test: | ||
name: Run Tests | ||
needs: [lint] | ||
|
@@ -47,11 +45,9 @@ jobs: | |
contents: read | ||
checks: write | ||
|
||
# Finally run the release job | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
# Only run release on main branch and when not triggered by automated commits | ||
if: | | ||
github.ref == 'refs/heads/main' && | ||
github.actor != 'github-actions[bot]' && | ||
|
@@ -66,32 +62,20 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT_TOKEN }} | ||
ref: ${{ github.sha }} | ||
|
||
- name: Force correct release branch | ||
run: | | ||
git checkout -B ${{ github.ref_name }} ${{ github.sha }} | ||
- name: Setup Python and Dependencies | ||
run: | | ||
pip install python-semantic-release==9.15.0 | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: "pip" | ||
|
||
- name: Generate Changelog | ||
env: | ||
GH_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
- name: Install Poetry | ||
run: | | ||
# Generate changelog regardless of release | ||
semantic-release changelog | ||
pip install poetry==1.8.5 | ||
poetry config virtualenvs.create false | ||
# Commit changelog if changed | ||
if [[ -n $(git status --porcelain CHANGELOG.md) ]]; then | ||
git pull origin ${{ github.ref_name }} --rebase | ||
git add CHANGELOG.md | ||
git commit -m "docs: update CHANGELOG.md [skip ci]" | ||
git push origin HEAD:${{ github.ref_name }} | ||
fi | ||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Python Semantic Release | ||
id: release | ||
|
@@ -103,10 +87,9 @@ jobs: | |
force: ${{ inputs.force != 'none' && inputs.force || '' }} | ||
git_committer_name: "github-actions[bot]" | ||
git_committer_email: "41898282+github-actions[bot]@users.noreply.github.com" | ||
|
||
- name: Publish to GitHub Release Assets | ||
uses: python-semantic-release/[email protected] | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.PAT_TOKEN }} | ||
tag: ${{ steps.release.outputs.tag }} | ||
changelog: true | ||
commit: true | ||
push: true | ||
build: true | ||
tag: true | ||
vcs_release: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters