Skip to content

Commit

Permalink
test new config
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidham3 committed Dec 20, 2024
1 parent 6b47cbd commit c37c5f2
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 82 deletions.
54 changes: 52 additions & 2 deletions .github/workflows/build_docs_vtag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build v Docs
name: Build v Docs and Publish

on:
workflow_run:
Expand All @@ -8,8 +8,16 @@ on:

jobs:
build:

runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/trajdl

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -78,3 +86,45 @@ jobs:
git add .
git commit -m "Update documentation from source repository" || echo "No changes to commit"
git push origin ${{ steps.branch-name.outputs.branch }}
- name: Prepare distribution files
run: |
mkdir -p final_dist
cp -r dist/*/* final_dist/
ls final_dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: final_dist/
skip_existing: true

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_RELEASE }}
run: >-
gh release create
'${{ github.event.workflow_run.head_branch }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_RELEASE }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.event.workflow_run.head_branch }}' dist/**
--repo '${{ github.repository }}'
81 changes: 1 addition & 80 deletions .github/workflows/publish_vtag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,83 +7,4 @@ on:
- completed

jobs:
publish:
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/trajdl

permissions:
id-token: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: dist-${{ github.event.workflow_run.head_branch }}-${{ github.sha }}-${{ matrix.python-version }}
path: dist
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.PAT_FOR_ARTIFACTS }}

- name: Prepare distribution files
run: |
mkdir -p final_dist
cp -r dist/*/* final_dist/
ls final_dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
packages_dir: final_dist/
skip_existing: true

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore and upload them to GitHub Release
needs:
- publish
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: dist-${{ github.event.workflow_run.head_branch }}-${{ github.sha }}-${{ matrix.python-version }}
path: dist
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.PAT_FOR_ARTIFACTS }}

- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_RELEASE }}
run: >-
gh release create
'${{ github.event.workflow_run.head_branch }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.PAT_FOR_RELEASE }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.event.workflow_run.head_branch }}' dist/**
--repo '${{ github.repository }}'

0 comments on commit c37c5f2

Please sign in to comment.