PacketMediator/.gitea/workflows/release.yaml

88 lines
2.7 KiB
YAML
Raw Normal View History

2024-08-07 19:57:19 +00:00
name: Release Rai.PacketMediator
2024-02-08 11:55:35 +00:00
run-name: ${{ gitea.actor }} is building the Server application
on:
push:
tags:
2024-08-07 19:57:19 +00:00
- v*.*.*
2024-02-08 11:55:35 +00:00
paths-ignore:
2024-08-07 19:57:19 +00:00
- .run/**
2024-02-08 11:55:35 +00:00
jobs:
preprocess:
runs-on: ubuntu-latest
outputs:
sanitized_branch_name: ${{ steps.sanitize.outputs.sanitized_branch_name }}
steps:
2024-08-07 19:57:19 +00:00
- name: Sanitize branch name
id: sanitize
run: echo "::set-output name=sanitized_branch_name::$(echo ${{ github.ref_name }} | sed 's/\//-/g')"
2024-02-08 11:55:35 +00:00
build:
runs-on: ubuntu-latest
steps:
2024-08-07 19:57:19 +00:00
- uses: actions/checkout@v4
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Install dependencies
run: dotnet restore
- name: Build
run: |
cd RaiNote.PacketMediator
dotnet build RaiNote.PacketMediator.csproj -c Release
2024-02-08 11:55:35 +00:00
publish:
2024-08-07 19:57:19 +00:00
needs: [build]
2024-02-08 11:55:35 +00:00
runs-on: ubuntu-latest
steps:
2024-08-07 19:57:19 +00:00
- uses: actions/checkout@v4
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Install dependencies
run: dotnet restore
- name: Extract Version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "Extracted version is $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
- name: Pack nuget package
run: |
cd RaiNote.PacketMediator
dotnet build RaiNote.PacketMediator.csproj -c Release -p:PackageVersion=${{env.VERSION}}
dotnet pack -c Release -p:PackageVersion=${{env.VERSION}} --output .
- name: Push to NuGet
run: |
cd RaiNote.PacketMediator
dotnet nuget push "*.nupkg" --api-key ${{secrets.nuget_api_key}} --source https://forge.rainote.dev/api/packages/rainote/nuget/index.json
2024-02-08 11:55:35 +00:00
generate-licences:
2024-08-07 19:57:19 +00:00
needs: [build, preprocess]
2024-02-08 11:55:35 +00:00
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest@sha256:efe7d859ca6f98a21b3b0471ab48455af597a064d719f65332d0f105aadcad65
2024-02-08 11:55:35 +00:00
steps:
2024-08-07 19:57:19 +00:00
- uses: actions/checkout@v4
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
dotnet-version: |
7.0
8.0
- name: Install dependencies
run: |
dotnet restore
echo "::add-path::$HOME/.dotnet/tools"
- name: Install nuget-license
run: dotnet tool install --global dotnet-project-licenses
- name: Export licenses
run: dotnet-project-licenses -i . -u --projects-filter projects_ignore_licenses.json -m -j -e -f licenses
- name: Upload licenses
uses: actions/upload-artifact@v3
with:
name: licenses
path: licenses
retention-days: 31