[deps]: Update System.IdentityModel.Tokens.Jwt to v8 #96
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
name: Publish | |
on: | |
pull_request: | |
release: | |
types: | |
- "published" | |
jobs: | |
version: | |
name: Calculate version | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
steps: | |
- name: Determine stable version | |
id: stable-version | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
if ! [[ "${{ github.event.release.tag_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z].*)?$ ]]; then | |
echo "Invalid version tag: ${{ github.event.release.tag_name }}" | |
exit 1 | |
fi | |
if ! [[ "${{ github.event.release.name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z].*)?$ ]]; then | |
echo "Invalid version: ${{ github.event.release.name }}" | |
exit 1 | |
fi | |
echo "version=${{ github.event.release.name }}" >> $GITHUB_OUTPUT | |
- name: Determine prerelease version | |
id: pre-version | |
if: ${{ github.event_name != 'release' }} | |
run: | | |
hash="${{ github.event.pull_request.head.sha }}" | |
echo "version=0.0.0-${hash:0:7}" >> $GITHUB_OUTPUT | |
outputs: | |
version: ${{ steps.stable-version.outputs.version || steps.pre-version.outputs.version }} | |
pack: | |
name: Package | |
needs: version | |
runs-on: ubuntu-22.04 | |
permissions: | |
actions: write | |
contents: read | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up .NET | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0 | |
- name: Pack | |
run: dotnet pack -p:Version=${{ needs.version.outputs.version }} -p:ContinuousIntegrationBuild=true --configuration Release | |
- name: Upload artifacts | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: packages | |
path: "**/*.nupkg" | |
publish: | |
name: Publish | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event_name == 'release' }} | |
needs: | |
- version | |
- pack | |
strategy: | |
matrix: | |
environment: | |
- ghpr | |
- nuget | |
exclude: | |
# exclude nuget for prereleases | |
- environment: ${{ github.event.release.prerelease && 'nuget' }} | |
steps: | |
- name: Dispatch publishing | |
env: | |
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }} | |
run: > | |
gh workflow run publish-nuget.yml | |
--repo bitwarden/devops | |
--field repository=${{ github.event.repository.name }} | |
--field run-id=${{ github.run_id }} | |
--field artifact=packages | |
--field environment=${{ matrix.environment }} | |
--field version=${{ needs.version.outputs.version }} |