ci: add nightly builds

This commit is contained in:
Naxdy 2024-03-25 16:25:55 +01:00
parent 71aab17866
commit c8d9c1063e
Signed by: Naxdy
GPG key ID: CC15075846BCE91B

View file

@ -0,0 +1,45 @@
name: Publish nightly release
on:
push:
branches: ["main"]
concurrency:
group: main
cancel-in-progress: true
jobs:
build:
runs-on: instance-wide
container: nixpkgs/nix-flakes:latest
steps:
- name: Set up packages
run: |
echo "extra-substituters = https://builder.naxdy.org/attic" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = attic:05LdE8Nav5Qd1E+KOJqSwdr+WE1z8AUmSb3oKL7s8dk=" >> /etc/nix/nix.conf
nix profile install nixpkgs#nodejs "github:zhaofengli/attic?ref=6eabc3f02fae3683bffab483e614bebfcd476b21"
echo "PATH=/nix/var/nix/profiles/per-user/root/profile/bin:$PATH" >> "$GITHUB_ENV"
- name: Set up attic binary cache
run: |
attic login "${{ vars.BINARY_CACHE_NAME }}" "${{ vars.BINARY_CACHE_URL }}" "${{ secrets.BINARY_CACHE_AUTH_KEY }}"
attic use "${{ vars.BINARY_CACHE_NAME }}"
- name: Prepare SSH key
run: |
mkdir -p dist && mkdir -p ~/.ssh
ssh-keyscan git.naxdy.org >> ~/.ssh/known_hosts
- uses: actions/checkout@v4
- name: Build firmware image
run: |
attic watch-store "${{ vars.BINARY_CACHE_NAME }}" &
nix build .# -o dist --print-build-logs
attic push "${{ vars.BINARY_CACHE_NAME }}" dist
- name: Publish nightly release
uses: https://gitea.com/actions/gitea-release-action@v1.3.0
with:
token: "${{ github.token }}"
tag_name: nightly
prerelease: true
name: "Nightly Release"
files: |
dist/bin/*