From 2df2a8469553d32eb439280b47a896da81bb4e6b Mon Sep 17 00:00:00 2001 From: Tyler Mathis <35553152+tsmathis@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:16:06 -0700 Subject: [PATCH 1/2] release gh action + dummy placeholder changelog --- .github/workflows/release.yml | 67 ++++++++++++++++++++++++++++++++--- docs/CHANGELOG.md | 0 2 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 docs/CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5dc867c..6def586 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,65 @@ name: release on: - push: - branches: [master] - pull_request: - branches: [master] -# TODO: setup release to pypi + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/mp-cite + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + python-version: 3.12 + + - name: Build + run: uv-build + + - name: Publish + run: uv-publish --trusted-publishing always + + docs: + runs-on: ubuntu-latest + needs: + - publish + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v6 + with: + python-version: 3.12 + + - name: Install deps + run: uv sync --locked --all-extras --dev + + - name: Generate changelog + uses: charmixer/auto-changelog-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + exclude_labels: dependencies + + - name: Commit files + run: | + git config --local user.email "feedback@materialsproject.org" + git config --local user.name "materialsproject" + git stash + git pull origin main + mv CHANGELOG.md docs/ + git add docs/CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} +# integrate mkdocs at some point diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md new file mode 100644 index 0000000..e69de29 From 2259dca299f064e96d2ddd2e241555685f8bc213 Mon Sep 17 00:00:00 2001 From: Tyler Mathis <35553152+tsmathis@users.noreply.github.com> Date: Mon, 14 Jul 2025 16:17:02 -0700 Subject: [PATCH 2/2] rm unnecessary fetch bounds for checkout action --- .github/workflows/testing.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9d761c9..67e0f21 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -17,8 +17,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Install uv uses: astral-sh/setup-uv@v6