Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus G K Williams <Marcus G K Williams [email protected]>
  • Loading branch information
Marcus G K Williams authored and Marcus G K Williams committed Nov 15, 2023
1 parent 1cf00b1 commit 1c7ecad
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 62 deletions.
30 changes: 8 additions & 22 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-dnf/
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -176,35 +177,20 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: steps.check-version.outputs.prerelease == 'true'
name: "Lava ${{ steps.check-version.outputs.release-version }}"
name: "Lava DNF ${{ 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 1c7ecad

Please sign in to comment.