Skip to content

Commit bba75a4

Browse files
committed
Run uv sync before pushing example code
1 parent ed290c8 commit bba75a4

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/_example.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@ jobs:
1313
with:
1414
# Need this to get version number from last tag
1515
fetch-depth: 0
16+
path: python-copier-template
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
1620

1721
- name: Regenerate example
1822
run: |
19-
pipx run copier copy --data-file example-answers.yml --vcs-ref=HEAD . example
23+
git init --initial-branch=main example
24+
uvx copier copy --data-file python-copier-template/example-answers.yml --vcs-ref=HEAD python-copier-template example
2025
2126
- name: Rewrite copier answers
2227
run: |
2328
sed -i 's|_src_path: .|_src_path: https://github.com/DiamondLightSource/python-copier-template.git|' example/.copier-answers.yml
2429
30+
- name: Update the lockfile
31+
run: uv sync --directory example
32+
2533
- name: Publish example
2634
# We pin to the SHA, not the tag, for security reasons.
2735
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
@@ -30,6 +38,6 @@ jobs:
3038
deploy_key: ${{ secrets.EXAMPLE_DEPLOY_KEY }}
3139
publish_dir: example
3240
external_repository: DiamondLightSource/python-copier-template-example
33-
publish_branch: main
41+
publish_branch: example-test
3442
enable_jekyll: true # don't put a .nojekyll
35-
exclude_assets: '' # default would exclude .github
43+
exclude_assets: '.git' # default would exclude .github

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
example:
3030
needs: test
31-
if: github.ref_name == 'main'
3231
uses: ./.github/workflows/_example.yml
3332
secrets:
3433
EXAMPLE_DEPLOY_KEY: ${{ secrets.EXAMPLE_DEPLOY_KEY }}

0 commit comments

Comments
 (0)