chore: add release-please to ci #433
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: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# Required by release-please | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
NUGET_XMLDOC_MODE: skip | |
HUSKY: 0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install .NET (v8.0) | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 8.0.x | |
- name: Test | |
run: | | |
dotnet test --configuration Debug | |
dotnet test --configuration Release | |
- name: Publish | |
run: dotnet publish src/Noted -o src/Noted/bin/Publish/ --configuration Release | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Noted.${{ matrix.os }} | |
path: src/Noted/bin/Publish/ | |
- name: Release please | |
uses: googleapis/release-please-action@v4 | |
id: release | |
if: github.ref == 'refs/heads/master' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: simple | |
publish: | |
if: contains(github.ref, 'tags/v') # only publish tagged versions | |
needs: [test] | |
runs-on: ubuntu-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
NUGET_XMLDOC_MODE: skip | |
HUSKY: 0 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET (v8.0) | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 8.x | |
- name: Build | |
run: | | |
dotnet publish src/Noted -c Release --self-contained false -r win-x64 -o ./src/Noted/bin/Portable.win-x64 | |
dotnet publish src/Noted -c Release --self-contained false -r linux-x64 -o ./src/Noted/bin/Portable.linux-x64 | |
dotnet publish src/Noted -c Release --self-contained -r win-x64 -o ./src/Noted/bin/win-x64 | |
dotnet publish src/Noted -c Release --self-contained -r linux-x64 -o ./src/Noted/bin/linux-x64 | |
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.Portable.win-x64.zip ./src/Noted/bin/Portable.win-x64 -r | |
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.Portable.linux-x64.zip ./src/Noted/bin/Portable.linux-x64 -r | |
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.win-x64.zip ./src/Noted/bin/win-x64 -r | |
7z a src/Noted/bin/Noted.${{ steps.extract_version.outputs.version }}.linux-x64.zip ./src/Noted/bin/linux-x64 -r | |
ls -l src/Noted/bin | |
- name: Upload artifact signatures to GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
run: >- | |
gh release upload | |
'${{ github.ref_name }}' src/Noted/bin/*.zip | |
--repo '${{ github.repository }}' |