Skip to content

Start of cleanup

Start of cleanup #1

Workflow file for this run

name: Publish
env:
NUGET_OUTPUT: ./Artifacts/NuGet
DOTNET_VERSION: "7.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@v3
- name: Setup .Net
uses: actions/setup-dotnet@v3
with:
dotnet-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 -r linux-x64 -p:PublishReadyToRun=true --self-contained -o out/x64
dotnet-arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup .Net
uses: actions/setup-dotnet@v3
with:
dotnet-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 -r linux-arm64 -p:PublishReadyToRun=true --self-contained -o out/arm64
workbench:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
id: workbench-output
with:
path: ./Source/Workbench/wwwroot
key: ${{ env.WORKBENCH_CACHE }}
- name: Setup node v16
uses: actions/setup-node@v3
with:
node-version: 16.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
run: yarn install
- name: Build JS/TS
run: |
export NODE_OPTIONS="--max-old-space-size=4096"
yarn build
- name: Build Workbench
working-directory: ./Source/Workbench
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@v3
- name: Release
id: release
uses: aksio-insurtech/release-action@v1
with:
user-name: "Aksio Build"
user-email: "build@aksio.no"
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@v3
- name: Setup .Net
uses: actions/setup-dotnet@v3
with:
dotnet-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@v3
- 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/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: |
aksioinsurtech/cratis:${{ needs.release.outputs.version }}
aksioinsurtech/cratis: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@v3
- uses: actions/cache@v3
id: workbench-output
with:
path: ./Source/Workbench/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: |
aksioinsurtech/cratis:${{ needs.release.outputs.version }}-workbench
aksioinsurtech/cratis: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@v3
- 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/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: |
aksioinsurtech/cratis:${{ needs.release.outputs.version }}-development
aksioinsurtech/cratis:latest-development
build-args: |
VERSION=${{ needs.release.outputs.version }}