Skip to content

Commit

Permalink
Update create-release workflow to include built files
Browse files Browse the repository at this point in the history
  • Loading branch information
evilmarty committed Jun 29, 2024
1 parent d5f758c commit 2588f98
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,29 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: version
run: |
version=$(sed -n -E '/VERSION/s/[^=]+=\s*//p' src/safaribookmarks/version.py | sed -E 's/(^[^"]*"|"[^"]*$)//g')
tag="v${version}"
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "/repos/${GITHUB_REPOSITORY}/releases/tags/${tag}" || (
- uses: actions/checkout@v4
- id: version
run: |
version=$(sed -n -E '/VERSION/s/[^=]+=\s*//p' src/safaribookmarks/version.py | sed -E 's/(^[^"]*"|"[^"]*$)//g')
tag="v${version}"
echo "new_version=${version}" >> "$GITHUB_OUTPUT"
echo "new_tag=${tag}" >> "$GITHUB_OUTPUT"
)
- name: Create release
if: steps.version.outputs.new_version
uses: softprops/action-gh-release@v2
with:
tag_name: "${{steps.version.outputs.new_tag}}"
target_commitish: ${{github.sha}}
generate_release_notes: true
prerelease: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[build]
- name: Build package
run: hatch build
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: "${{steps.version.outputs.new_tag}}"
target_commitish: ${{github.sha}}
generate_release_notes: true
draft: true
files: |
dist/**
21 changes: 5 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,13 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
uses: robinraju/release-downloader@v1.11
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[build]
- name: Build package
run: hatch build
- name: Update release
uses: softprops/action-gh-release@v2
with:
tag_name: "${{github.event.release.tag_name}}"
fail_on_unmatched_files: true
files: |
dist/**
releaseId: ${{ github.event.release.id }}
tarBall: false
zipBall: false
out-file-path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit 2588f98

Please sign in to comment.