From 65e711f0783eaee8fa391c446dd094d8da9cc5b7 Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Tue, 20 Aug 2024 17:11:34 +0900 Subject: [PATCH] update github action scripts --- .github/workflows/deploy_docs.yml | 2 +- .github/workflows/deploy_pypi.yml | 19 ++++++++++++------- .github/workflows/python_package.yml | 8 ++++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 250c837d..dd8e9510 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -11,7 +11,7 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4.x diff --git a/.github/workflows/deploy_pypi.yml b/.github/workflows/deploy_pypi.yml index 6541253d..d533005b 100644 --- a/.github/workflows/deploy_pypi.yml +++ b/.github/workflows/deploy_pypi.yml @@ -1,4 +1,4 @@ -name: Deploy python package +name: Deploy python package to PyPI on: push: @@ -6,8 +6,12 @@ on: jobs: deploy: - runs-on: ubuntu-20.04 - if: github.repository == 'issp-center-dev/PHYSBO' + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/physbo + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Checkout uses: actions/checkout@v4 @@ -19,9 +23,10 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools build twine + python -m pip install -U pip + python -m pip install build - name: Publish - run: | - python -m build -s - python -m twine upload -u __token__ -p "${{ secrets.PYPI_DEPLOY_TOKEN }}" dist/* + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true \ No newline at end of file diff --git a/.github/workflows/python_package.yml b/.github/workflows/python_package.yml index 7413f21e..2cfbf9e1 100644 --- a/.github/workflows/python_package.yml +++ b/.github/workflows/python_package.yml @@ -1,6 +1,10 @@ -name: Python package +name: Test python package -on: [push] +on: + push: + pull_request: + schedule: + - cron: '0 0 1,15 * *' # JST 9:00 AM, 1st and 15th of every month jobs: build: