chore(deps): update all dependencies #260
This file contains hidden or 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: Combined CI / Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
jobs: | |
shared_ci_cd: | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
uses: mu88/github-actions/.github/workflows/ci-cd.yml@f252e7d1c94652b5e51996174f6e2977ef88f1a5 | |
with: | |
requires-docker-login: true | |
sonar-key: 'mu88_mu88.Shared' | |
sonar-additional-params: '/d:sonar.cs.opencover.reportsPaths=tests/Tests/coverage.opencover.xml /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml' | |
secrets: | |
sonar-token: ${{ secrets.SONAR_TOKEN }} | |
ci_cd: | |
runs-on: ubuntu-latest | |
needs: shared_ci_cd | |
permissions: | |
id-token: write # enable GitHub OIDC token issuance for this job | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 # otherwise Versionize cannot read the Git history and the pre-release version cannot be bumped | |
- name: Set up .NET | |
uses: actions/setup-dotnet@v5 | |
with: | |
cache: true | |
cache-dependency-path: "**/packages.lock.json" | |
global-json-file: global.json | |
- name: Bump pre-release version | |
if: ${{ needs.shared_ci_cd.outputs.is-release != 'true' }} | |
run: | | |
dotnet tool restore | |
# Although no commit or tag is made, we still need to set the git user to avoid Versionize errors | |
git config --global user.name "John Doe" | |
git config --global user.email johndoe@example.com | |
dotnet tool run versionize \ | |
--pre-release "alpha.${{ github.run_number }}.${{ github.run_attempt }}" \ | |
--skip-commit \ | |
--skip-tag \ | |
--find-release-commit-via-message | |
- name: Pack .NET project and create NuGet package | |
run: dotnet pack src/mu88.Shared/mu88.Shared.csproj | |
- name: NuGet login | |
uses: NuGet/login@v1 | |
id: login | |
with: | |
user: ${{ secrets.NUGET_USER }} | |
- name: Publish NuGet package | |
run: | | |
dotnet nuget push src/mu88.Shared/bin/Release/mu88.Shared.*.nupkg \ | |
--api-key ${{steps.login.outputs.NUGET_API_KEY}} \ | |
--source https://api.nuget.org/v3/index.json |