Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
push:
branches: [master]
tags: ["*"]
workflow_dispatch:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling this workflow for pushed tags should resolve the following problem with Codecov:

Coverage data is based on head 8e9a87f (15 uploads) compared to base f215a23 (30 uploads)

30 instead of 15 uploads are cause by the two CI runs triggered by the pushed release commit to master and the tag that references that same commit.

inputs:
pytest_addopts:
Expand Down Expand Up @@ -115,37 +114,3 @@ jobs:

# Run tests
- run: devenv test

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs:
- build
- flake-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needs all tags to compute dynamic version
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
enable-cache: "true"
cache-suffix: "3.13"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Build dist
run: uv build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_token_copier }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token_copier }}
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: release

on:
push:
branches: [master]
tags: ["*"]

env:
# renovate: datasource=pypi depName=uv
UV_VERSION: "0.6.16"

jobs:
build:
name: Build project for distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}

- name: Build project for distribution
run: uv build

- name: Upload artifact containing distribution files
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
if-no-files-found: error

publish-test:
name: Publish package distributions to test.pypi.org
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi-test
url: https://test.pypi.org/p/copier
permissions:
id-token: write

steps:
- name: Download artifact containing distribution files
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Upload package distributions
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/

publish:
name: Publish package distributions to pypi.org
runs-on: ubuntu-latest
needs: [publish-test]
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/p/copier
permissions:
id-token: write

steps:
- name: Download artifact containing distribution files
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Upload package distributions
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
Loading