-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update core commit; create patch workflow
- Loading branch information
1 parent
651ce37
commit b19e763
Showing
2 changed files
with
94 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: deploy-patch | ||
|
||
on: | ||
# Currently this workflow only runs when triggered manually. Perhaps we can set it up to run when a tag is pushed. Or when a release is made. Or that it could create a release, on a release it can create a tag? | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
poetry-version: ['1.1.13'] | ||
os: [ubuntu-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry ${{ matrix.poetry-version }} | ||
run: | | ||
python -m ensurepip | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry==${{ matrix.poetry-version }} | ||
- name: Install dependencies | ||
shell: bash | ||
run: | | ||
python -m poetry install | ||
python -m poetry run python scripts/fetch_core.py | ||
python -m poetry run python scripts/zip_templates.py | ||
- name: Test with pytest | ||
run: | | ||
python -m poetry run pytest -v | ||
deploy: | ||
needs: test | ||
name: Deploy to pypi | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# Sets up python3 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8.5 | ||
|
||
# Setup poetry | ||
- name: Install poetry | ||
run: | | ||
ensurepip | ||
pip install --upgrade pip | ||
pip install poetry | ||
- name: Install dependencies | ||
shell: bash | ||
run: poetry install | ||
|
||
- name: Build package | ||
run: poetry run python scripts/build_package.py | ||
|
||
- name: Publish | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish --build | ||
- name: Update version | ||
run: poetry version patch | ||
|
||
- name: setup git config | ||
run: | | ||
# setup the username and email. | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
- name: commit | ||
run: | | ||
# Stage the file, commit and push | ||
git add pyproject.toml | ||
git commit -m "bump version to next patch level for nightlies" | ||
git push origin main |
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