Add more actions #4
Workflow file for this 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
name: release.yml | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- feature/changesets | ||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | ||
DOTNET_VERSION: 8.0.x | ||
NODE_VERSION: 20.x | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 | ||
with: | ||
egress-policy: audit | ||
disable-telemetry: true | ||
- name: "Checkout code" | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
persist-credentials: false | ||
- name: Setup dotnet 8 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
- name: Setup Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Corepack | ||
run: corepack enable | ||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
- name: Dotnet restore | ||
run: dotnet restore **./*.csproj --locked-mode | ||
- name: Dotnet build | ||
run: dotnet build **./*.csproj --configuration Release --no-restore | ||
- name: Test with dotnet | ||
run: dotnet test --configuration Release --no-restore --logger trx --results-directory "TestResults" | ||
- name: Upload dotnet test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dotnet-results | ||
path: TestResults | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} | ||
- name: Create Release Pull Request or Publish | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: yarn changeset version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish | ||
if: steps.changesets.outputs.hasChangesets == 'false' | ||
# You can do something when a publish should happen. | ||
run: | | ||
echo "Publishing to nuget" | ||
dotnet pack src/Serilog.Extensions.Formatting -c Release --version-suffix beta -o ./artifacts |