chore(lint): 改进代码样式 (#31) #14
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: 打包最新版为 Docker Image | |
on: [push] | |
jobs: | |
docker-builder: | |
name: build docker | |
runs-on: ubuntu-23.04 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@master | |
- run: sudo apt-get install -y qemu-user-static | |
- name: Set up nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
sandbox = true | |
- name: Speed Up nix | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: build docker | |
run: | | |
mkdir output/ | |
# https://discourse.nixos.org/t/nix-github-actions-aarch64/11034 | |
nix build .#packages.aarch64-linux.docker_builder -o aarch64-linux.docker --print-out-paths --option system aarch64-linux --extra-platforms aarch64-linux | |
cp $(readlink aarch64-linux.docker) ./output/aarch64-linux.docker.tar.gz | |
nix build .#packages.x86_64-linux.docker_builder -o x86_64-linux.docker --print-out-paths --option system x86_64-linux --extra-platforms x86_64-linux | |
cp $(readlink x86_64-linux.docker) ./output/x86_64-linux.docker.tar.gz | |
# gomod2nix did not provide this | |
# nix build .#packages.i686-linux.docker_builder -o i686-linux.docker --print-out-paths --option system i686-linux --extra-platforms i686-linux | |
# cp $(readlink i686-linux.docker) ./output/i686-linux.docker.tar.gz | |
- name: Upload artifact | |
uses: actions/upload-artifact@master | |
if: ${{ !github.head_ref }} | |
with: | |
path: output/ |