-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: github actions for publishing (#141)
- Loading branch information
Showing
8 changed files
with
168 additions
and
50 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Title | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
title-format: | ||
permissions: | ||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs | ||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,67 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
id: release | ||
with: | ||
release-type: python | ||
package-name: haptools | ||
|
||
- uses: actions/checkout@v3 | ||
if: ${{ steps.release.outputs.release_created }} | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Set up Python | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Upgrade pip | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt pip | ||
pip --version | ||
- name: Install Poetry | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
pip install --constraint=.github/workflows/constraints.txt poetry | ||
poetry --version | ||
- name: Bump version for developmental release | ||
if: ${{ steps.release.outputs.release_created }} | ||
env: | ||
version: ${{ steps.release.outputs.tag_name }} | ||
run: | | ||
poetry version $version | ||
- name: Build package | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
poetry build --ansi | ||
- name: Publish package on TestPyPI | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: {{ "${{ secrets.TEST_PYPI_TOKEN }}" }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish package on PyPI | ||
if: ${{ steps.release.outputs.release_created }} | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: {{ "${{ secrets.PYPI_TOKEN }}" }} |
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,13 +1,12 @@ | ||
name: Tests | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
tests: | ||
name: ${{"{{"}} matrix.session {{"}}"}} ${{"{{"}} matrix.python {{"}}"}} / ${{"{{"}} matrix.os {{"}}"}} | ||
runs-on: ${{"{{"}} matrix.os {{"}}"}} | ||
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -17,22 +16,22 @@ jobs: | |
- { python: "3.8", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.9", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.10", os: "ubuntu-latest", session: "tests" } | ||
- { python: "3.10", os: "windows-latest", session: "tests" } | ||
# - { python: "3.10", os: "windows-latest", session: "tests" } | ||
- { python: "3.10", os: "macos-latest", session: "tests" } | ||
|
||
env: | ||
NOXSESSION: ${{"{{"}} matrix.session {{"}}"}} | ||
NOXSESSION: ${{ matrix.session }} | ||
FORCE_COLOR: "1" | ||
PRE_COMMIT_COLOR: "always" | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{"{{"}} matrix.python {{"}}"}} | ||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{"{{"}} matrix.python {{"}}"}} | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Upgrade pip | ||
run: | | ||
|
@@ -56,7 +55,7 @@ jobs: | |
nox --version | ||
- name: Run Nox | ||
run: | | ||
nox --python=${{"{{"}} matrix.python {{"}}"}} | ||
nox --python=${{ matrix.python }} | ||
- name: Upload coverage data | ||
if: always() && matrix.session == 'tests' | ||
uses: "actions/upload-artifact@v3" | ||
|
@@ -101,4 +100,4 @@ jobs: | |
# run: | | ||
# nox --session=coverage -- xml | ||
# - name: Upload coverage report | ||
# uses: codecov/[email protected] | ||
# uses: codecov/[email protected] |
Empty file.
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
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