-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the release to publish a release archive.
PiperOrigin-RevId: 705578400
- Loading branch information
1 parent
e58b1fe
commit 20493d4
Showing
3 changed files
with
66 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,61 +17,93 @@ name: Release | |
on: # yamllint disable-line rule:truthy | ||
|
||
# postsubmit | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
# DO_NOT_SUBMIT | ||
# push: | ||
# tags: | ||
# - 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
|
||
test-package: | ||
name: Test Package | ||
uses: ./.github/workflows/test_package.yaml | ||
|
||
publish-to-pypi: | ||
name: Publish to PyPI | ||
needs: [test-package] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/federated-language | ||
permissions: | ||
id-token: write # Required for trusted publishing. | ||
steps: | ||
# publish-to-pypi: | ||
# name: Publish to PyPI | ||
# needs: [test-package] | ||
# runs-on: ubuntu-latest | ||
# timeout-minutes: 5 | ||
# environment: | ||
# name: pypi | ||
# url: https://pypi.org/p/federated-language | ||
# permissions: | ||
# id-token: write # Required for trusted publishing. | ||
# steps: | ||
|
||
- name: Download package | ||
uses: actions/[email protected] | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
# - name: Download package | ||
# uses: actions/[email protected] | ||
# with: | ||
# name: python-package-distributions | ||
# path: dist/ | ||
|
||
- name: Publish | ||
uses: pypa/[email protected] | ||
# - name: Publish | ||
# uses: pypa/[email protected] | ||
|
||
release-to-github: | ||
name: Release to GitHub | ||
needs: [publish-to-pypi] | ||
needs: [test-package] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: write # Required for creating GitHub Releases. | ||
id-token: write # Requried for sigstore. | ||
steps: | ||
|
||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Download package | ||
uses: actions/[email protected] | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: gh-action-sigstore-python | ||
- name: Create archive | ||
run: | | ||
tag="${{ github.ref_name }}" | ||
echo "${tag}" | ||
version="${tag#v}" | ||
echo "${version}" | ||
ls -la "dist" | ||
pwd | ||
git tag --list | ||
git archive \ | ||
--prefix="federated-language-0.1.0-B" \ | ||
--output="dist/federated-language-0.1.0-B.tar.gz" \ | ||
'v0.1.0' | ||
ls -la "dist" | ||
# - name: Download release archive | ||
# run: | | ||
# curl \ | ||
# --output dist/federated-language-0.1.0.tar.gz \ | ||
# https://github.com/google-parfait/federated-language/archive/v0.1.0.tar.gz | ||
|
||
- name: Create Sigstore signatures | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: | | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
- name: Create GitHub release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
|
@@ -81,7 +113,7 @@ jobs: | |
--repo '${{ github.repository }}' \ | ||
--draft | ||
- name: Upload artifacts to GitHub Release | ||
- name: Upload artifacts to GitHub release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters