-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create package only once * Split deploy in two steps * Uploaded packages also to GitHub releases
- Loading branch information
1 parent
5818160
commit c9a4d13
Showing
2 changed files
with
44 additions
and
15 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 |
---|---|---|
|
@@ -10,12 +10,8 @@ on: | |
|
||
jobs: | ||
|
||
deploy: | ||
package: | ||
runs-on: ubuntu-latest | ||
environment: deploy | ||
permissions: | ||
id-token: write # For PyPI trusted publishers. | ||
contents: write # For tag and release notes. | ||
env: | ||
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }} | ||
|
||
|
@@ -25,6 +21,17 @@ jobs: | |
- name: Build and Check Package | ||
uses: hynek/[email protected] | ||
|
||
deploy: | ||
needs: package | ||
runs-on: ubuntu-latest | ||
environment: deploy | ||
permissions: | ||
id-token: write # For PyPI trusted publishers. | ||
contents: write # For tag and release notes. | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download Package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
@@ -36,7 +43,9 @@ jobs: | |
|
||
- name: Push tag | ||
run: | | ||
git tag v${{ github.event.inputs.version }} ${{ github.sha }} | ||
git config user.name "pytest bot" | ||
git config user.email "[email protected]" | ||
git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }} | ||
git push origin v${{ github.event.inputs.version }} | ||
- name: Set up Python | ||
|
@@ -54,3 +63,4 @@ jobs: | |
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: scripts/latest-release-notes.md | ||
files: dist/* |
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 |
---|---|---|
@@ -1,15 +1,31 @@ | ||
name: test | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- "test-me-*" | ||
|
||
pull_request: | ||
|
||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and Check Package | ||
uses: hynek/[email protected] | ||
|
||
test: | ||
|
||
needs: [package] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
|
@@ -31,21 +47,24 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download Package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install tox | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox | ||
- name: Test | ||
shell: bash | ||
run: | | ||
tox -e ${{ matrix.tox_env }} | ||
check-package: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build and Check Package | ||
uses: hynek/[email protected] | ||
tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz` |