diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index c4dd317b..541d276d 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -11,20 +11,20 @@ jobs: runs-on: ubuntu-latest if: ${{ contains(github.ref, 'release/') }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Install poetry - run: pip install poetry - - name: Bump version - run: git branch --show-current | sed 's|release/||' | xargs poetry version | { printf '::set-output name=PR_TITLE::'; cat; } - id: bump - - name: Bump version 2 - run: git branch --show-current | sed 's|release/||' | xargs -I {} echo '__version__ = "{}"' > pams/version.py - - name: Create pull request - uses: peter-evans/create-pull-request@v3 - with: - author: GitHub Actions - commit-message: ${{ steps.bump.outputs.PR_TITLE }} - delete-branch: true - branch-suffix: short-commit-hash - title: ${{ steps.bump.outputs.PR_TITLE }} + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Install poetry + run: pip install poetry + - name: Bump version + run: git branch --show-current | sed 's|release/||' | xargs poetry version | { printf '::set-output name=PR_TITLE::'; cat; } + id: bump + - name: Bump version 2 + run: git branch --show-current | sed 's|release/||' | xargs -I {} echo '__version__ = "{}"' > pams/version.py + - name: Create pull request + uses: peter-evans/create-pull-request@v3 + with: + author: GitHub Actions + commit-message: ${{ steps.bump.outputs.PR_TITLE }} + delete-branch: true + branch-suffix: short-commit-hash + title: ${{ steps.bump.outputs.PR_TITLE }} diff --git a/.github/workflows/ci-python-min.yml b/.github/workflows/ci-python-min.yml index afb3a9a6..b426f84f 100644 --- a/.github/workflows/ci-python-min.yml +++ b/.github/workflows/ci-python-min.yml @@ -6,9 +6,9 @@ name: CI-min on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ dev, release/* ] + branches: [dev, release/*] pull_request: - branches: [ dev, release/* ] + branches: [dev, release/*] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,12 +18,12 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} strategy: max-parallel: 5 matrix: platform: [ubuntu-latest] - python-version: [3.9] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/ci-python-notebooks.yml b/.github/workflows/ci-python-notebooks.yml index f2b5ca26..b1f0b1ae 100644 --- a/.github/workflows/ci-python-notebooks.yml +++ b/.github/workflows/ci-python-notebooks.yml @@ -6,9 +6,9 @@ name: CI-notebooks on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main, dev, release/* ] + branches: [main, dev, release/*] pull_request: - branches: [ main, dev, release/* ] + branches: [main, dev, release/*] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,12 +18,12 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} strategy: max-parallel: 5 matrix: platform: [ubuntu-latest] - python-version: [3.8] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index bc8dfcfa..7d77213a 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,12 +18,12 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} strategy: max-parallel: 5 matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -47,4 +47,4 @@ jobs: - name: Doc Test if: matrix.platform == 'ubuntu-latest' run: | - poetry run pytest --doctest-modules pams + poetry run pytest --doctest-modules pams diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 18baae52..2c1bd3de 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -6,9 +6,9 @@ name: codecov CI on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main, dev, release/* ] + branches: [main, dev, release/*] pull_request: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -21,26 +21,26 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2.2.2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install poetry - poetry install - - name: make cov report - run: | - poetry run pytest --cov=./ --cov-report=xml - - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: ./coverage.xml - flags: pytest - verbose: true + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install poetry + poetry install + - name: make cov report + run: | + poetry run pytest --cov=./ --cov-report=xml + - uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./coverage.xml + flags: pytest + verbose: true diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 57889af4..cc4cd646 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -8,12 +8,12 @@ on: jobs: doc: - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} strategy: max-parallel: 5 matrix: platform: [ubuntu-latest] - python-version: [3.9] + python-version: [3.11] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37cd92c3..b929c35d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,42 +1,42 @@ name: Release on: - pull_request: - branches: - - main - types: - - closed + pull_request: + branches: + - main + types: + - closed jobs: tagging: runs-on: ubuntu-latest if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') steps: - - name: Get the version - id: get_version - run: | - echo ::set-output name=TAG::`echo $SOURCE_VERSION | cut -d / -f 2` - env: - SOURCE_VERSION: ${{ github.event.pull_request.head.ref }} - - name: Echo tag - run: echo ${{ steps.get_version.outputs.TAG }} - - uses: actions/checkout@v2 - - run: | - git config --global user.email "masa.hirano.1996@gmail.com" - git config --global user.name "Masanori HIRANO" - git fetch origin ${{ github.event.pull_request.head.ref }} - git checkout main - git tag -a `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release\///'` -m " " - git push origin `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release\///'` + - name: Get the version + id: get_version + run: | + echo ::set-output name=TAG::`echo $SOURCE_VERSION | cut -d / -f 2` + env: + SOURCE_VERSION: ${{ github.event.pull_request.head.ref }} + - name: Echo tag + run: echo ${{ steps.get_version.outputs.TAG }} + - uses: actions/checkout@v2 + - run: | + git config --global user.email "masa.hirano.1996@gmail.com" + git config --global user.name "Masanori HIRANO" + git fetch origin ${{ github.event.pull_request.head.ref }} + git checkout main + git tag -a `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release\///'` -m " " + git push origin `echo '${{ github.event.pull_request.head.ref }}' | sed 's/release\///'` test: # The type of runner that the job will run on name: final test - runs-on: ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} needs: tagging strategy: max-parallel: 5 matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -57,7 +57,7 @@ jobs: poetry run pflake8 . poetry run mypy . poetry run pytest tests/ - + releasetest: # The type of runner that the job will run on name: release test @@ -65,32 +65,32 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2.2.2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install poetry - poetry install - - name: test release - run: | - poetry config repositories.testpypi https://test.pypi.org/legacy/ - poetry publish --build -r testpypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} - + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install poetry + poetry install + - name: test release + run: | + poetry config repositories.testpypi https://test.pypi.org/legacy/ + poetry publish --build -r testpypi --username __token__ --password ${{ secrets.TEST_PYPI_TOKEN }} + releasetestcheck: name: release test check needs: releasetest runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -117,82 +117,82 @@ jobs: - name: Test run: | pytest tests/ - + release: name: release needs: [releasetestcheck, tagging] runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9] + python-version: [3.11] # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Get the version - id: get_version - run: | - echo ::set-output name=TAG::`echo $SOURCE_VERSION | cut -d / -f 2` - env: - SOURCE_VERSION: ${{ github.event.pull_request.head.ref }} - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2.2.2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install poetry - poetry install - - name: release - run: | - poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} - - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.get_version.outputs.TAG }} - release_name: ${{ steps.get_version.outputs.TAG }} - draft: false - prerelease: false - body: | - ${{ github.event.pull_request.body }} - - This release is automatically generated. - Please see the pull request. - [${{ github.event.pull_request.html_url }}](${{ github.event.pull_request.html_url }}) - - name: Generate checksum - run: | - cd dist; sha256sum * > checksums.txt; cd - - - name: Upload tar.gz - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/pams-${{ steps.get_version.outputs.TAG }}.tar.gz - asset_name: pams-${{ steps.get_version.outputs.TAG }}.tar.gz - asset_content_type: application/gzip - - name: Upload whl - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/pams-${{ steps.get_version.outputs.TAG }}-py3-none-any.whl - asset_name: pams-${{ steps.get_version.outputs.TAG }}-py3-none-any.whl - asset_content_type: application/x-pywheel+zip - - name: Upload checksum - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/checksums.txt - asset_name: pams-${{ steps.get_version.outputs.TAG }}-checksums.txt - asset_content_type: text/plain - - name: remove branch - run: | - git push --delete origin ${{ github.event.pull_request.head.ref }} + - name: Get the version + id: get_version + run: | + echo ::set-output name=TAG::`echo $SOURCE_VERSION | cut -d / -f 2` + env: + SOURCE_VERSION: ${{ github.event.pull_request.head.ref }} + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install poetry + poetry install + - name: release + run: | + poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get_version.outputs.TAG }} + release_name: ${{ steps.get_version.outputs.TAG }} + draft: false + prerelease: false + body: | + ${{ github.event.pull_request.body }} + + This release is automatically generated. + Please see the pull request. + [${{ github.event.pull_request.html_url }}](${{ github.event.pull_request.html_url }}) + - name: Generate checksum + run: | + cd dist; sha256sum * > checksums.txt; cd - + - name: Upload tar.gz + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/pams-${{ steps.get_version.outputs.TAG }}.tar.gz + asset_name: pams-${{ steps.get_version.outputs.TAG }}.tar.gz + asset_content_type: application/gzip + - name: Upload whl + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/pams-${{ steps.get_version.outputs.TAG }}-py3-none-any.whl + asset_name: pams-${{ steps.get_version.outputs.TAG }}-py3-none-any.whl + asset_content_type: application/x-pywheel+zip + - name: Upload checksum + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: dist/checksums.txt + asset_name: pams-${{ steps.get_version.outputs.TAG }}-checksums.txt + asset_content_type: text/plain + - name: remove branch + run: | + git push --delete origin ${{ github.event.pull_request.head.ref }}