Skip to content

v2.0.1

v2.0.1 #30

Workflow file for this run

name: Release
on:
release:
types: ["published"]
jobs:
build:
name: Build & Test
uses: ./.github/workflows/build-test.yml
permissions:
id-token: write
contents: read
checks: write
secrets: inherit
version:
name: Parse version
runs-on: ubuntu-latest
outputs:
version_3: ${{ steps.version.outputs.version_3 }}
version_suffix: ${{ steps.version.outputs.version_suffix }}
version_full: ${{ steps.version.outputs.version_full }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse version
id: version
run: .\build\Get-Version.ps1 -Ref '${{ github.ref }}'
shell: pwsh
publish-nuget:
name: Publish NuGet
runs-on: ubuntu-latest
needs:
- build
- version
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore dependencies
run: dotnet restore
- name: Pack
run: dotnet pack -p:VersionPrefix="${{ needs.version.outputs.version_3 }}" --version-suffix "${{ needs.version.outputs.version_suffix }}"
- name: Publish
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
working-directory: .nupkgs
- name: Upload artifact to action
uses: actions/upload-artifact@v4
with:
name: nupkgs
path: .nupkgs/
- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: ".nupkgs/*.nupkg"
repo-token: ${{ secrets.GITHUB_TOKEN }}
publish-hub:
name: Publish Hub
uses: ./.github/workflows/publish-dotnet-docker-image.yml
needs:
- version
- build
permissions:
contents: read
packages: write
with:
project_path: src/LogOtter.Hub
version: ${{ needs.version.outputs.version_full }}
secrets: inherit
tag-latest:
name: Tag Hub latest release
runs-on: ubuntu-latest
needs:
- version
- publish-hub
permissions:
contents: read
packages: write
steps:
- name: Get latest release
id: latest-release
uses: gregziegan/[email protected]
- name: Login to the Container Registry
if: format('refs/tags/{0}', steps.latest-release.outputs.tag_name) == ${{ github.ref }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag latest release
if: format('refs/tags/{0}', steps.latest-release.outputs.tag_name) == ${{ github.ref }}
uses: airbone95/[email protected]
with:
ghcr_repo: logotter/hub
ghcr_username: ${{ github.actor }}
ghcr_password: ${{ secrets.GITHUB_TOKEN }}
old_tag: ${{ needs.version.outputs.version_full }}
new_tag: latest