task: Bump to net8.0 #90
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: build | |
on: [push, pull_request] | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
outputs: | |
AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }} | |
AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }} | |
SemVer: ${{ steps.gitversion.outputs.semVer }} | |
ShortSha: ${{ steps.gitversion.outputs.shortSha }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: x # Latest | |
- name: Use GitVersion | |
id: gitversion | |
uses: gittools/actions/gitversion/[email protected] | |
build_and_test: | |
runs-on: ubuntu-latest | |
outputs: | |
artifact_name: ${{ steps.prepare_artifacts.outputs.artifact_name }} | |
needs: prepare | |
steps: | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0 | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: dotnet build -c Release | |
- name: Test | |
run: dotnet test --no-restore | |
- name: Publish | |
run: dotnet publish --no-restore -c Release -o release /p:"AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }};FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }};InformationalVersion=${{ steps.gitversion.outputs.SemVer }}-${{ steps.gitversion.outputs.ShortSha }}" | |
- name: Prepare artifacts | |
id: prepare_artifacts | |
run: | | |
cp {README,xvd_info,CHANGELOG}.md release | |
echo "artifact_name=XVDTool-${{ needs.prepare.outputs.SemVer }}-${{ needs.prepare.outputs.ShortSha }}" >> $GITHUB_OUTPUT | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ steps.prepare_artifacts.outputs.artifact_name }} | |
path: release | |
if-no-files-found: error | |
create_release: | |
runs-on: ubuntu-latest | |
needs: [prepare, build_and_test] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
- name: Generate zip | |
run: zip -j XVDTool-${{ needs.prepare.outputs.AssemblySemVer }}.zip ${{ needs.build_and_test.outputs.artifact_name }}/* | |
- name: Create release (on tag) | |
uses: softprops/action-gh-release@e99df7cd8088d9c5dddab02bf975f62025a6e760 | |
with: | |
name: Release ${{ github.ref }} | |
tag_name: ${{ github.ref }} | |
files: 'XVDTool-*.zip' | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |