From 897b98c95a1db5d220dcce058379565dce8cb193 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Mon, 27 Jan 2025 12:24:07 +0400 Subject: [PATCH 1/2] automated release --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 32 +++++++++++++++++++++----------- .pre-commit-config.yaml | 8 -------- copyright.txt | 13 ------------- 4 files changed, 22 insertions(+), 33 deletions(-) delete mode 100644 copyright.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfe97369..5f8f60b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: "ci" +name: "CI" on: - push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0fd94c9c..b80fe83e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,37 @@ -name: Upload Python Package +name: Bump version and publish on: - release: - types: [published] + workflow_run: + workflows: [ "CI" ] + types: [ completed ] jobs: - build: + tag: + permissions: + contents: write + + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'main' + runs-on: ubuntu-latest + steps: - name: Checkout [${{ github.repository }}] uses: actions/checkout@v4 - - uses: cvxgrp/.github/actions/uv/build@v2.0.6 + - name: Generate Tag + uses: cvxgrp/.github/actions/uv/tag@v2.0.8 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} - deploy: + publish: + needs: tag runs-on: ubuntu-latest - needs: build environment: release permissions: + contents: read # This permission is required for trusted publishing. id-token: write @@ -26,13 +39,10 @@ jobs: - name: Checkout [${{ github.repository }}] uses: actions/checkout@v4 - # download dist from build - uses: actions/download-artifact@v4 with: name: dist path: dist - - name: Publish package distributions to PyPI + - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://upload.pypi.org/legacy/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46dd107d..20330c14 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,14 +34,6 @@ repos: - id: check-github-workflows args: ["--verbose"] - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.5 - hooks: - - id: insert-license - files: ^(cvx) - args: - ['--license-filepath', 'copyright.txt', '--no-extra-eol'] - - repo: https://github.com/rhysd/actionlint rev: v1.7.7 hooks: diff --git a/copyright.txt b/copyright.txt deleted file mode 100644 index 4d376402..00000000 --- a/copyright.txt +++ /dev/null @@ -1,13 +0,0 @@ - Copyright 2023 Stanford University Convex Optimization Group - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. From 21a83f73757f3d1c7d61b565afe9b0ad200a1115 Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Mon, 27 Jan 2025 23:20:57 +0400 Subject: [PATCH 2/2] automated release --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b80fe83e..ed8088ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v4 - name: Generate Tag - uses: cvxgrp/.github/actions/uv/tag@v2.0.8 + uses: cvxgrp/.github/actions/uv/tag@v2.0.9 with: github_token: ${{ secrets.GITHUB_TOKEN }}