-
-
Notifications
You must be signed in to change notification settings - Fork 684
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release workflow to use separate tokens per package
- Loading branch information
Showing
2 changed files
with
45 additions
and
12 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 |
---|---|---|
|
@@ -23,7 +23,6 @@ jobs: | |
- flake8 | ||
# - towncrier-check | ||
- docs | ||
- package | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/[email protected] | ||
|
@@ -35,15 +34,29 @@ jobs: | |
python -m pip install --upgrade setuptools | ||
python -m pip install tox | ||
- run: tox -e ${{ matrix.task }} | ||
- if: matrix.task == 'package' | ||
uses: actions/upload-artifact@v3 | ||
|
||
package: | ||
needs: beefore | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.min_python_version }} | ||
- run: pip install tox | ||
- run: tox -e package | ||
- name: Collect packages | ||
run: | | ||
mkdir packages | ||
mv {.,demo,src/*}/dist/* packages | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: "**/dist" | ||
path: packages | ||
if-no-files-found: error | ||
|
||
core: | ||
needs: beefore | ||
needs: package | ||
strategy: | ||
matrix: | ||
platform: ['macos', 'ubuntu', 'windows'] | ||
|
@@ -64,9 +77,10 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: packages | ||
- name: Test | ||
env: | ||
TOGA_INSTALL_COMMAND: 'bash -c "pip install src/{core,dummy}/dist/*.whl"' | ||
TOGA_INSTALL_COMMAND: 'bash -c "pip install packages/toga_{core,dummy}*.whl"' | ||
run: | | ||
tox -e py | ||
- if: matrix.platform == 'ubuntu' && matrix.python-version == env.min_python_version | ||
|
@@ -78,7 +92,7 @@ jobs: | |
fail_ci_if_error: true | ||
|
||
backend: | ||
needs: beefore | ||
needs: package | ||
strategy: | ||
matrix: | ||
backend: [android, cocoa, gtk, iOS, web, winforms] | ||
|
@@ -112,13 +126,14 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: packages | ||
- name: Install dependencies | ||
run: | | ||
${{ matrix.pre-command }} | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade setuptools | ||
python -m pip install pytest-tldr | ||
python -m pip install src/{core,dummy,${{ matrix.backend }}}/dist/*.whl | ||
python -m pip install packages/toga_{core,dummy,${{ matrix.backend }}}*.whl | ||
- name: Test | ||
run: | | ||
cd src/${{ matrix.backend }} | ||
|
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
jobs: | ||
ci: | ||
uses: ./.github/workflows/ci.yml | ||
|
||
release: | ||
name: Create Release | ||
needs: ci | ||
|
@@ -22,17 +23,34 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
- name: Collect packages | ||
run: mv {demo,src/*}/dist/* dist | ||
path: packages | ||
- name: Create Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
name: ${{ env.VERSION }} | ||
draft: true | ||
artifacts: "dist/*" | ||
artifacts: "packages/*" | ||
artifactErrorsFailBuild: true | ||
|
||
deploy-test: | ||
needs: release | ||
strategy: | ||
matrix: | ||
package: ["toga", "toga_android", "toga_cocoa", "toga_core", "toga_demo", | ||
"toga_dummy", "toga_gtk", "toga_iOS", "toga_web", "toga_winforms"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get packages | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages | ||
path: packages | ||
- name: Extract ${{ matrix.package }} | ||
run: | | ||
mkdir dist | ||
mv packages/$(echo ${{ matrix.package }} | sed 's/_/?/')* dist | ||
- name: Publish release to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository_url: https://test.pypi.org/legacy/ | ||
password: ${{ secrets.TEST_PYPI_PASSWORD }} | ||
password: ${{ secrets[format('TEST_PYPI_PASSWORD_{0}', matrix.package)] }} |