Skip to content

Bump YamlDotNet from 15.1.0 to 15.1.1 (#4) #48

Bump YamlDotNet from 15.1.0 to 15.1.1 (#4)

Bump YamlDotNet from 15.1.0 to 15.1.1 (#4) #48

Workflow file for this run

name: .NET
on:
push:
branches: "main"
pull_request:
branches: "main"
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
publish:
name: Publish for ${{ matrix.platform }}-${{ matrix.arch }} (${{ matrix.self-contained == 'true' && 'self-contained' || 'runtime' }})
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
permissions:
contents: write
strategy:
matrix:
# The runtime id will be composed based on parts of the .NET Known RIDs (https://learn.microsoft.com/en-us/dotnet/core/rid-catalog#known-rids)
arch: ["x64", "arm64"]
platform: ["win", "linux"]
self-contained: ["true", "false"]
steps:
- uses: actions/checkout@v4
- name: Restore dependencies
run: dotnet restore --runtime ${{ matrix.platform }}-${{ matrix.arch }}
- name: Publish for ${{ matrix.platform }}-${{ matrix.arch }} (${{ matrix.self-contained == 'true' && 'self-contained' || 'runtime' }})
run: dotnet publish Hexus --no-restore --runtime ${{ matrix.platform }}-${{ matrix.arch }} --self-contained ${{ matrix.self-contained }}
- name: Prepare artifact for CI release
run: |
mv artifacts/publish/Hexus/release_${{ matrix.platform }}-${{ matrix.arch }}/Hexus${{ matrix.platform == 'win' && '.exe' || '' }} hexus${{ matrix.platform == 'win' && '.exe' || '' }}
tar -czf ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.self-contained == 'true' && 'self-contained' || 'runtime' }}.tar.gz hexus${{ matrix.platform == 'win' && '.exe' || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.self-contained == 'true' && 'self-contained' || 'runtime' }}
path: hexus${{ matrix.platform == 'win' && '.exe' || '' }}
if-no-files-found: error
- name: Upload artifact to CI release
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ci ${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.self-contained == 'true' && 'self-contained' || 'runtime' }}.tar.gz --clobber
edit-ci-release:
name: Edit CI release
runs-on: ubuntu-latest
needs: [build, publish]
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Edit CI release
env:
GH_TOKEN: ${{ github.token }}
run: gh release edit ci -n "CI build for commit $GITHUB_SHA"