Fix/job request deiscriminator #980
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: Publish | |
env: | |
NUGET_OUTPUT: ./Artifacts/NuGet | |
DOTNET8_VERSION: "8.0.405" | |
DOTNET_VERSION: "9.0.x" | |
DOTNET_X64_CACHE: "dotnet-x64-cache-${{ github.sha }}" | |
DOTNET_ARM64_CACHE: "dotnet-arm64-cache-${{ github.sha }}" | |
WORKBENCH_CACHE: "web-cache-${{ github.sha }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to release' | |
required: true | |
default: '0.0.0' | |
type: string | |
release-notes: | |
description: 'Release notes' | |
required: true | |
default: 'No release notes' | |
type: string | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
type: choice | |
options: | |
- info | |
- warning | |
- debug | |
pull_request: | |
types: [closed] | |
branches: | |
- "**" | |
paths: | |
- "**" | |
- "!Docker/BaseDevelopment/**" | |
jobs: | |
dotnet-x64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .Net | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
${{ env.DOTNET8_VERSION }} | |
${{ env.DOTNET_VERSION }} | |
- uses: actions/cache@v3 | |
id: dotnet-x64-output | |
with: | |
path: ./Source/Kernel/Server/out/x64 | |
key: ${{ env.DOTNET_X64_CACHE }} | |
- name: Build x64 Kernel - self contained, ready to run | |
working-directory: ./Source/Kernel/Server | |
run: dotnet publish -c Release -f net9.0 -r linux-x64 -p:PublishReadyToRun=true -p:DisableProxyGenerator=true --self-contained -o out/x64 | |
dotnet-arm64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .Net | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
${{ env.DOTNET8_VERSION }} | |
${{ env.DOTNET_VERSION }} | |
- uses: actions/cache@v3 | |
id: dotnet-arm64-output | |
with: | |
path: ./Source/Kernel/Server/out/arm64 | |
key: ${{ env.DOTNET_ARM64_CACHE }} | |
- name: Build arm64 Kernel - self contained, ready to run | |
working-directory: ./Source/Kernel/Server | |
run: dotnet publish -c Release -f net9.0 -r linux-arm64 -p:PublishReadyToRun=true -p:DisableProxyGenerator=true --self-contained -o out/arm64 | |
workbench: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
id: workbench-output | |
with: | |
path: ./Source/Workbench/Web/wwwroot | |
key: ${{ env.WORKBENCH_CACHE }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
registry-url: "https://registry.npmjs.org" | |
- uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
.yarn/cache | |
**/node_modules | |
**/.eslintcache | |
**/yarn.lock | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }} | |
- name: Yarn install | |
working-directory: ./Source/Workbench/Web | |
run: yarn install | |
- name: Build Workbench | |
working-directory: ./Source/Workbench/Web | |
run: | | |
yarn build | |
release: | |
runs-on: ubuntu-latest | |
needs: [dotnet-x64, dotnet-arm64, workbench] | |
outputs: | |
version: ${{ steps.release.outputs.version }} | |
publish: ${{ steps.release.outputs.should-publish }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Release | |
id: release | |
uses: cratis/release-action@v1 | |
with: | |
version: ${{ github.event.inputs.version }} | |
release-notes: ${{ github.event.inputs.release-notes }} | |
publish-dotnet-packages: | |
if: needs.release.outputs.publish == 'true' | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
id: workbench-output | |
with: | |
path: ./Source/Workbench/Web/wwwroot | |
key: ${{ env.WORKBENCH_CACHE }} | |
- name: Setup .Net | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
${{ env.DOTNET8_VERSION }} | |
${{ env.DOTNET_VERSION }} | |
- name: Remove any existing artifacts | |
run: rm -rf ${{ env.NUGET_OUTPUT }} | |
- name: Build | |
run: dotnet build --configuration Release | |
- name: Create NuGet packages | |
run: dotnet pack --no-build --configuration Release -o ${{ env.NUGET_OUTPUT }} -p:PackageVersion=${{ needs.release.outputs.version }} | |
- name: Push NuGet packages | |
run: dotnet nuget push --skip-duplicate '${{ env.NUGET_OUTPUT }}/*.nupkg' --timeout 900 --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
publish-docker-production: | |
if: needs.release.outputs.publish == 'true' | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
id: dotnet-x64-output | |
with: | |
path: ./Source/Kernel/Server/out/x64 | |
key: ${{ env.DOTNET_X64_CACHE }} | |
- uses: actions/cache@v3 | |
id: dotnet-arm64-output | |
with: | |
path: ./Source/Kernel/Server/out/arm64 | |
key: ${{ env.DOTNET_ARM64_CACHE }} | |
- uses: actions/cache@v3 | |
id: workbench-output | |
with: | |
path: ./Source/Workbench/Web/wwwroot | |
key: ${{ env.WORKBENCH_CACHE }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build Production Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./Docker/Production/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
cratis/chronicle:${{ needs.release.outputs.version }} | |
cratis/chronicle:latest | |
build-args: | | |
VERSION=${{ needs.release.outputs.version }} | |
publish-docker-workbench: | |
if: needs.release.outputs.publish == 'true' | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
id: workbench-output | |
with: | |
path: ./Source/Workbench/Web/wwwroot | |
key: ${{ env.WORKBENCH_CACHE }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build Workbench Image | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./Docker/Workbench/Dockerfile | |
push: true | |
tags: | | |
cratis/chronicle:${{ needs.release.outputs.version }}-workbench | |
cratis/chronicle:latest-workbench | |
build-args: | | |
VERSION=${{ needs.release.outputs.version }} | |
publish-docker-development: | |
if: needs.release.outputs.publish == 'true' | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
id: dotnet-x64-output | |
with: | |
path: ./Source/Kernel/Server/out/x64 | |
key: ${{ env.DOTNET_X64_CACHE }} | |
- uses: actions/cache@v3 | |
id: dotnet-arm64-output | |
with: | |
path: ./Source/Kernel/Server/out/arm64 | |
key: ${{ env.DOTNET_ARM64_CACHE }} | |
- uses: actions/cache@v3 | |
id: workbench-output | |
with: | |
path: ./Source/Workbench/Web/wwwroot | |
key: ${{ env.WORKBENCH_CACHE }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build Development Docker Image | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: . | |
file: ./Docker/Development/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: | | |
cratis/chronicle:${{ needs.release.outputs.version }}-development | |
cratis/chronicle:latest-development | |
build-args: | | |
VERSION=${{ needs.release.outputs.version }} | |
- name: Trigger Documentation Build | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.PAT_DOCUMENTATION }} | |
repository: cratis/documentation | |
event-type: build-docs | |