2025-01-16 10:40:44 +01:00
|
|
|
## SPDX-FileCopyrightText: 2025 Gergely Nagy
|
|
|
|
## SPDX-FileContributor: Gergely Nagy
|
|
|
|
##
|
|
|
|
## SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
2025-01-25 11:47:13 +01:00
|
|
|
paths:
|
|
|
|
- '.forgejo/workflows/build.yaml'
|
|
|
|
- 'flake.nix'
|
|
|
|
- 'flake.lock'
|
|
|
|
- 'nix/**'
|
|
|
|
- 'Cargo.*'
|
|
|
|
- 'src/**'
|
2025-01-28 09:02:21 +01:00
|
|
|
- 'templates/**'
|
2025-01-16 10:40:44 +01:00
|
|
|
|
|
|
|
jobs:
|
2025-01-29 08:16:36 +01:00
|
|
|
binary:
|
2025-01-16 10:40:44 +01:00
|
|
|
runs-on: nixos-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: setup magic attic cache
|
|
|
|
uses: actions/magic-attic-cache@main
|
|
|
|
with:
|
|
|
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
uses: actions/nix/build@main
|
|
|
|
with:
|
|
|
|
logs: true
|
|
|
|
package: iocaine
|
2025-01-16 19:31:44 +01:00
|
|
|
|
2025-01-29 08:16:36 +01:00
|
|
|
binary-static:
|
|
|
|
runs-on: nixos-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: setup magic attic cache
|
|
|
|
uses: actions/magic-attic-cache@main
|
|
|
|
with:
|
|
|
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
|
|
|
|
- name: build
|
|
|
|
uses: actions/nix/build@main
|
|
|
|
with:
|
|
|
|
logs: true
|
|
|
|
package: iocaine-static
|
|
|
|
|
|
|
|
- name: compress the binary
|
|
|
|
uses: actions/nix/develop@main
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
zstd result/bin/iocaine
|
|
|
|
|
|
|
|
- name: determine the version
|
|
|
|
uses: actions/nix/develop@main
|
|
|
|
id: ver
|
|
|
|
with:
|
|
|
|
run: |
|
2025-01-29 08:29:43 +01:00
|
|
|
echo "ver=$(cargo info -q iocaine | grep "^version:" | cut -d " " -f 2)" >>"${GITHUB_OUTPUT}"
|
2025-01-29 08:16:36 +01:00
|
|
|
|
|
|
|
- name: upload package
|
|
|
|
uses: actions/nix/develop@main
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
curl --user :${{ secrets.DOCKER_PASSWORD }} -XDELETE \
|
|
|
|
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/${{ steps.ver.outputs.ver }}
|
|
|
|
curl --user :${{ secrets.DOCKER_PASSWORD }} \
|
|
|
|
--upload-file result/bin/iocaine.zstd \
|
|
|
|
https://git.madhouse-project.org/api/packages/algernon/generic/iocaine/${{ steps.ver.outputs.ver }}/iocaine.zstd
|
|
|
|
|
|
|
|
container:
|
|
|
|
runs-on: nixos-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: setup magic attic cache
|
|
|
|
uses: actions/magic-attic-cache@main
|
|
|
|
with:
|
|
|
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
|
2025-01-16 19:31:44 +01:00
|
|
|
- name: build the container image
|
|
|
|
uses: actions/nix/build@main
|
|
|
|
with:
|
|
|
|
logs: true
|
|
|
|
package: container-image
|
|
|
|
|
|
|
|
- name: load the container image into docker
|
|
|
|
run: |
|
|
|
|
docker load <result
|
|
|
|
|
|
|
|
- name: login to the container registry
|
|
|
|
uses: https://code.forgejo.org/docker/login-action@v2
|
|
|
|
with:
|
|
|
|
registry: git.madhouse-project.org
|
|
|
|
username: algernon
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: publish
|
|
|
|
run:
|
|
|
|
docker push git.madhouse-project.org/algernon/iocaine:latest
|
2025-01-25 11:47:13 +01:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: nixos-latest
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: setup magic attic cache
|
|
|
|
uses: actions/magic-attic-cache@main
|
|
|
|
with:
|
|
|
|
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
|
|
|
|
- name: clippy
|
|
|
|
uses: actions/nix/develop@main
|
|
|
|
with:
|
|
|
|
run: cargo clippy
|