From ff081d8de5792b18d01beeb3120fd8173494daf4 Mon Sep 17 00:00:00 2001 From: haasad Date: Sat, 18 Nov 2023 21:44:16 +0100 Subject: [PATCH 1/6] Use up-to-date action versions --- .github/workflows/changelog-release.yaml | 4 ++-- .github/workflows/conda-release.yaml | 2 +- .github/workflows/pypi-release.yaml | 4 ++-- .github/workflows/tests.yaml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/changelog-release.yaml b/.github/workflows/changelog-release.yaml index c51d842..9d1527d 100644 --- a/.github/workflows/changelog-release.yaml +++ b/.github/workflows/changelog-release.yaml @@ -8,12 +8,12 @@ jobs: dist: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: "0" - name: Build changelog from PRs with labels id: build_changelog - uses: mikepenz/release-changelog-builder-action@v2 + uses: mikepenz/release-changelog-builder-action@v4 with: configuration: ".github/changelog-configuration.json" # PreReleases still get a changelog, but the next full release gets a diff since the last full release, diff --git a/.github/workflows/conda-release.yaml b/.github/workflows/conda-release.yaml index e43addb..cc705e1 100644 --- a/.github/workflows/conda-release.yaml +++ b/.github/workflows/conda-release.yaml @@ -12,7 +12,7 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up miniconda with python 3.9 uses: conda-incubator/setup-miniconda@v2 with: diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index e58026e..ec7d012 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index cfd07b0..27ce2e0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -21,7 +21,7 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up miniconda with python ${{ matrix.python-version }} uses: conda-incubator/setup-miniconda@v2 with: @@ -56,7 +56,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 9dcdb6f0e16f27f4fd6d3b446f83616552e44564 Mon Sep 17 00:00:00 2001 From: haasad Date: Sat, 18 Nov 2023 23:44:04 +0100 Subject: [PATCH 2/6] Rename to github-release --- .../{changelog-release.yaml => github-release.yaml} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename .github/workflows/{changelog-release.yaml => github-release.yaml} (93%) diff --git a/.github/workflows/changelog-release.yaml b/.github/workflows/github-release.yaml similarity index 93% rename from .github/workflows/changelog-release.yaml rename to .github/workflows/github-release.yaml index 9d1527d..308702e 100644 --- a/.github/workflows/changelog-release.yaml +++ b/.github/workflows/github-release.yaml @@ -1,11 +1,13 @@ -name: Release +name: github-release on: push: + branches: + - master tags: - - v* + - 'v*' jobs: - dist: + github-release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 156b584cbd87085aa8b54e016e79a6ac6e651255 Mon Sep 17 00:00:00 2001 From: haasad Date: Sun, 19 Nov 2023 00:03:43 +0100 Subject: [PATCH 3/6] Use release token, so release can trigger new actions --- .github/workflows/github-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 308702e..3633e68 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -31,4 +31,4 @@ jobs: prerelease: "${{ contains(github.ref, '-rc') }}" # Ensure target branch for release is "master" commit: master - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.RELEASE_TOKEN }} From 142864cd9016d09148b6c8bde46e0932f7130eb5 Mon Sep 17 00:00:00 2001 From: haasad Date: Sun, 19 Nov 2023 00:06:15 +0100 Subject: [PATCH 4/6] Trigger pypi and conda release on github release --- .github/workflows/conda-release.yaml | 8 ++------ .github/workflows/pypi-release.yaml | 7 ++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/conda-release.yaml b/.github/workflows/conda-release.yaml index cc705e1..c25da98 100644 --- a/.github/workflows/conda-release.yaml +++ b/.github/workflows/conda-release.yaml @@ -1,12 +1,8 @@ name: conda-release on: - push: - branches: - - master - - conda-release - tags: - - 'v*' + release: + types: [published] jobs: build-and-publish: diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index ec7d012..509ccad 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -1,11 +1,8 @@ name: PyPI release on: - push: - branches: - - master - tags: - - 'v*' + release: + types: [published] jobs: build-and-publish: From 0a5e03b883f8a7d6704b0e163d434e249a401b98 Mon Sep 17 00:00:00 2001 From: haasad Date: Sun, 19 Nov 2023 00:21:33 +0100 Subject: [PATCH 5/6] Build conda recipe dynamically with grayskull --- .github/workflows/conda-release.yaml | 18 +++++++++--------- meta.yaml | 27 --------------------------- 2 files changed, 9 insertions(+), 36 deletions(-) delete mode 100644 meta.yaml diff --git a/.github/workflows/conda-release.yaml b/.github/workflows/conda-release.yaml index c25da98..bd5a65c 100644 --- a/.github/workflows/conda-release.yaml +++ b/.github/workflows/conda-release.yaml @@ -7,25 +7,25 @@ on: jobs: build-and-publish: runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} steps: - - uses: actions/checkout@v4 - name: Set up miniconda with python 3.9 uses: conda-incubator/setup-miniconda@v2 with: python-version: 3.9 - activate-environment: test - environment-file: environment.yml - auto-activate-base: false + activate-environment: build - name: Install build tools - shell: bash -l {0} run: | - conda install conda-build anaconda-client conda-verify + conda install conda-build anaconda-client conda-verify grayskull + - name: Generate conda recipe + run: | + grayskull pypi https://github.com/haasad/PyPardiso --sections {package,source,build,requirements,about} - name: Build conda package - shell: bash -l {0} run: | - conda build . + conda build PyPardiso - name: Upload to haasad conda channel if: startsWith(github.ref, 'refs/tags/v') - shell: bash -l {0} run: | anaconda -t ${{ secrets.CONDA_TOKEN }} upload /usr/share/miniconda/envs/test/conda-bld/noarch/*.tar.bz2 diff --git a/meta.yaml b/meta.yaml deleted file mode 100644 index 5977691..0000000 --- a/meta.yaml +++ /dev/null @@ -1,27 +0,0 @@ -package: - name: pypardiso - version: "0.4.3" - -source: - git_rev: origin/master - git_url: https://github.com/haasad/PyPardisoProject.git - -build: - noarch: python - script: "python setup.py install --single-version-externally-managed --record record.txt" - -requirements: - build: - - python - - setuptools - run: - - python - - mkl - - numpy - - scipy - -about: - home: https://github.com/haasad/PyPardisoProject - license: BSD - license_file: LICENSE.txt - summary: Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations From 81409d6fb602ce57deaa2441fc002a78fdcc3805 Mon Sep 17 00:00:00 2001 From: haasad Date: Sun, 19 Nov 2023 00:23:33 +0100 Subject: [PATCH 6/6] Setuptools-scm needs git history --- .github/workflows/pypi-release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml index 509ccad..d8c0496 100644 --- a/.github/workflows/pypi-release.yaml +++ b/.github/workflows/pypi-release.yaml @@ -11,6 +11,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: "0" - name: Set up python uses: actions/setup-python@v4 with: