-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'ca2c362' into 2024-10-24-pagination-buttons
- Loading branch information
Showing
49 changed files
with
2,825 additions
and
1,340 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- master | ||
- main | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
@@ -20,17 +21,14 @@ jobs: | |
build-on-macos: | ||
uses: livMatS/dtool-lookup-gui/.github/workflows/build-on-macos.yml@master | ||
|
||
publish-on-pypi: | ||
runs-on: ubuntu-22.04 | ||
build-python-package: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get history and tags for SCM versioning to work | ||
run: | | ||
git fetch --prune --unshallow | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
|
@@ -48,44 +46,89 @@ jobs: | |
gir1.2-gtk-3.0 \ | ||
libgtksourceview-4-0 | ||
- name: Install pythonic dependencies | ||
- name: Install requirements | ||
run: | | ||
pip install --upgrade pip | ||
pip install wheel build | ||
pip install -r requirements.txt | ||
pip install --upgrade build | ||
pip install --upgrade setuptools wheel setuptools-scm[toml] | ||
pip list | ||
- name: Package distribution | ||
run: | | ||
python -m build --sdist --wheel | ||
ls -1 dist/ | ||
python -m build | ||
- name: Get master HEAD SHA | ||
id: get_master_sha | ||
run: | | ||
git fetch --depth 1 origin master | ||
echo "Commit that triggered this workflow: ${{ github.sha }}" | ||
echo "HEAD at master: $(git rev-parse origin/master)" | ||
echo "sha=$(git rev-parse origin/master)" >> $GITHUB_OUTPUT | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
|
||
publish-to-testpypi: | ||
name: Publish to TestPyPI | ||
needs: | ||
- build-python-package | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/dtool-lookup-gui | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
- name: Publish package | ||
if: >- | ||
github.event_name == 'push' && | ||
startsWith(github.ref, 'refs/tags') && | ||
steps.get_master_sha.outputs.sha == github.sha | ||
uses: pypa/[email protected] | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
skip-existing: true | ||
|
||
publish-to-pypi: | ||
name: Publish to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build-python-package | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/dtool-lookup-gui # Replace <package-name> with your PyPI project name | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} | ||
verbose: true | ||
|
||
publish-on-github: | ||
runs-on: ubuntu-20.04 | ||
name: >- | ||
Make github release | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
needs: | ||
- build-on-ubuntu | ||
- build-on-macos | ||
- build-on-windows | ||
- build-installer-on-windows | ||
- publish-to-pypi | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -136,6 +179,19 @@ jobs: | |
run: | | ||
ls -lhv . | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Sign with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Get master HEAD SHA | ||
id: get_master_sha | ||
run: | | ||
|
@@ -144,16 +200,27 @@ jobs: | |
echo "HEAD at master: $(git rev-parse master)" | ||
echo "sha=$(git rev-parse origin/master)" >> $GITHUB_OUTPUT | ||
- name: Make release | ||
if: >- | ||
github.event_name == 'push' && | ||
startsWith(github.ref, 'refs/tags') && | ||
steps.get_master_sha.outputs.sha == github.sha | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-linux.tar.gz | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-macos.dmg | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-windows.zip | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-windows-installer.exe | ||
draft: true | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' \ | ||
--repo '${{ github.repository }}' \ | ||
dist/** \ | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-linux.tar.gz \ | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-macos.dmg \ | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-windows.zip \ | ||
dtool-lookup-gui-${{ steps.fix_version.outputs.version }}-windows-installer.exe |
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
Oops, something went wrong.