Skip to content

Commit

Permalink
Release 0.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus G K Williams <Marcus G K Williams 168222+mgkwill@users.noreply.github.com>
  • Loading branch information
Marcus G K Williams authored and Marcus G K Williams committed Nov 15, 2023
1 parent 1560458 commit 25f11b4
Show file tree
Hide file tree
Showing 3 changed files with 1,248 additions and 1,197 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ jobs:
name: Upload release artifact
runs-on: ubuntu-latest
if: github.triggering_actor == 'mgkwill' || github.triggering_actor == 'PhilippPlank' || github.triggering_actor == 'tim-shea'
outputs:
api-token: ${{ steps.mint-token.outputs.api-token}}
environment:
name: pypi
url: https://pypi.org/p/lava-optimization/
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -176,35 +177,21 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: steps.check-version.outputs.prerelease == 'true'
name: "Lava ${{ steps.check-version.outputs.release-version }}"
name: "Lava Optimization ${{ steps.check-version.outputs.release-version }}"
commit: "${{ steps.check-version.outputs.release-commit }}"
tag: "v${{ steps.check-version.outputs.release-version }}"
discussionCategory: "Announcements"
artifactErrorsFailBuild: true
generateReleaseNotes: true
makeLatest: true

- name: Mint Github API token
id: mint-token
run: |
# retrieve OIDC token
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
oidc_token=$(jq '.value' <<< "${resp}")
# exchange OIDC token for API token
resp=$(curl -X POST https://pypi.org/_/oidc/github/mint-token -d "{\"token\": \"${oidc_token}\"}")
api_token=$(jq '.token' <<< "${resp}")
# mask the API token, to prevent leaking it
echo "::add-mask::${api_token}"
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
- name: Publish to PyPI
if: steps.check-version.outputs.prerelease != 'true'
run: |
poetry config pypi-token.pypi ${{ steps.mint-token.outputs.api-token }}
mkdir dist
cp lava* dist/.
poetry publish
- name: Publish package distributions to PyPI
if: steps.check-version.outputs.prerelease != 'true'
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit 25f11b4

Please sign in to comment.