Skip to content

Update flake inputs #99

Update flake inputs

Update flake inputs #99

Workflow file for this run

name: Dev
on: [push]
defaults:
run:
shell: bash
jobs:
build-runner:
name: Build runner
runs-on: [self-hosted, nix, general, "${{ matrix.arch.runner }}", "${{ matrix.arch.size }}"]
timeout-minutes: 20
strategy:
matrix:
arch:
- nix: x86_64-linux
runner: amd64-linux
image: amd64
size: medium
- nix: aarch64-linux
runner: arm64-linux
image: arm64
size: medium
- nix: aarch64-darwin
runner: arm64-darwin
size: small
env:
IMAGE_REPOSITORY: public.ecr.aws/shopstic
outputs:
version: ${{ steps.determine-version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: determine-version
name: Determine current version
run: |-
CURRENT_VERSION=$(./release.sh get_release_version) || exit $?
echo "::set-output name=version::${CURRENT_VERSION}"
- name: Build intellij-scala-runners
run: |-
nix build -L --no-link '.#packages.${{ matrix.arch.nix }}.intellij-scala-runners'
- name: Build runner
run: |-
nix build -L --no-link '.#packages.${{ matrix.arch.nix }}.runner-jre'
- name: Cache runner
env:
NIX_OUTPUT: .#packages.${{ matrix.arch.nix }}.runner-jre
run: |
nix store sign "${NIX_OUTPUT}" -v -r -k ~/.secrets/nix-cache-private-key
nix copy -v "${NIX_OUTPUT}" --to s3://nixed/cache
- name: Cache intellij-scala-runners
env:
NIX_OUTPUT: .#packages.${{ matrix.arch.nix }}.intellij-scala-runners
run: |
nix store sign "${NIX_OUTPUT}" -v -r -k ~/.secrets/nix-cache-private-key
nix copy -v "${NIX_OUTPUT}" --to s3://nixed/cache
- name: Build container images
if: ${{ matrix.arch.image }}
run: |-
nix build -L '.#packages.${{ matrix.arch.nix }}.server-image'
- name: Push
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE_ARCH: ${{ matrix.arch.image }}
RELEASE_VERSION: ${{ steps.determine-version.outputs.version }}
if: ${{ matrix.arch.image }}
shell: nix develop -v -c bash {0}
run: |-
IMAGE_TAG="${RELEASE_VERSION}-${IMAGE_ARCH}"
IMAGE_TARGET="${IMAGE_REPOSITORY}"/toothpick-server:"${IMAGE_TAG}"
skopeo --insecure-policy copy \
nix:./result \
docker://"${IMAGE_TARGET}"
push-manifest:
name: Push multi-arch manifest
runs-on: [self-hosted, nix, general, arm64-linux, small]
timeout-minutes: 5
needs: [build-runner]
env:
IMAGE_REPOSITORY: public.ecr.aws/shopstic
steps:
- uses: actions/checkout@v3
- name: Push
shell: nix develop -v -c bash {0}
env:
GITHUB_SHA: ${{ github.sha }}
RELEASE_VERSION: ${{ needs.build-runner.outputs.version }}
run: |-
manifest-tool push from-args \
--platforms linux/amd64,linux/arm64 \
--template "${IMAGE_REPOSITORY}/toothpick-server:${RELEASE_VERSION}-ARCH" \
--target "${IMAGE_REPOSITORY}/toothpick-server:${RELEASE_VERSION}"
build-helm-chart:
name: Build Helm chart
runs-on: [self-hosted, nix, general, arm64-linux, small]
timeout-minutes: 5
needs: [build-runner]
env:
IMAGE_REPOSITORY: public.ecr.aws/shopstic
steps:
- uses: actions/checkout@v3
- name: Build and push Helm Chart
shell: nix develop -v -c bash {0}
env:
GITHUB_SHA: ${{ github.sha }}
RELEASE_VERSION: ${{ needs.build-runner.outputs.version }}
run: |-
export HELM_REGISTRY_CONFIG=/home/runner/.docker/config.json
./release.sh push_helm_chart "${RELEASE_VERSION}" "${RELEASE_VERSION}" "oci://${IMAGE_REPOSITORY}/charts"