Skip to content

release needs a tag, so let's start versioning #21

release needs a tag, so let's start versioning

release needs a tag, so let's start versioning #21

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
tags:
- '*'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
rid: linux-x64
- os: windows-latest
rid: win-x64
- os: macos-latest
rid: osx-x64
runs-on: ${{ matrix.os }}
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 --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish for ${{ matrix.rid }}
run: dotnet publish -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -p:UseAppHost=true -p:PublishTrimmed=true -o ./publish/${{ matrix.rid }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: FolderSync-${{ matrix.rid }}
path: ./publish/${{ matrix.rid }}
release:
name: Create release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: build-${{ github.run_number }}
name: build-${{ github.run_number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: ./artifacts/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}