Compare commits
No commits in common. "c277defca30016b844b0bd28a8c56cbfde0891a9" and "a2f17900bfefe1b4c2593ad8ad582812846d3b35" have entirely different histories.
c277defca3
...
a2f17900bf
|
@ -1,105 +0,0 @@
|
||||||
name: "Nix build"
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
jobs:
|
|
||||||
build-docker:
|
|
||||||
runs-on: debian-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: "Install prerequisites"
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y sudo zstd
|
|
||||||
- name: "Cache Nix store"
|
|
||||||
uses: actions/cache@v3.0.8
|
|
||||||
id: nix-cache
|
|
||||||
with:
|
|
||||||
path: /nix
|
|
||||||
key: "tclip-cache-v1"
|
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: https://github.com/cachix/install-nix-action@v22
|
|
||||||
with:
|
|
||||||
extra_nix_config: "experimental-features = nix-command flakes"
|
|
||||||
nix_path: nixpkgs=channel:nixos-23.05
|
|
||||||
- name: Remove access_tokens
|
|
||||||
run: sed -i '/^access-tokens/d' /etc/nix/nix.conf
|
|
||||||
- name: "Basic CLI and web build"
|
|
||||||
run: |
|
|
||||||
nix build .#tclip .#tclipd
|
|
||||||
|
|
||||||
- name: "Docker image build"
|
|
||||||
run: |
|
|
||||||
nix build .#docker
|
|
||||||
|
|
||||||
- name: Push image with Skopeo
|
|
||||||
run: |
|
|
||||||
nix-env -i skopeo -f '<nixpkgs>'
|
|
||||||
wget https://raw.githubusercontent.com/containers/skopeo/main/default-policy.json && mkdir /etc/containers && mv default-policy.json /etc/containers/policy.json
|
|
||||||
skopeo login --username arch --password $REGISTRY_TOKEN git.gmem.ca
|
|
||||||
skopeo copy docker-archive:result docker://git.gmem.ca/arch/tclip:latest
|
|
||||||
env:
|
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Portable service build"
|
|
||||||
run: |
|
|
||||||
nix build .#portable-service
|
|
||||||
mkdir -p var
|
|
||||||
cp ./result/*.raw ./var
|
|
||||||
- uses: https://github.com/actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: portable-service
|
|
||||||
path: ./var/*.raw
|
|
||||||
|
|
||||||
build-docker-arm:
|
|
||||||
runs-on: debian-latest-arm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: "Install prerequisites"
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y sudo zstd
|
|
||||||
- name: "Cache Nix store"
|
|
||||||
uses: actions/cache@v3.0.8
|
|
||||||
id: nix-cache
|
|
||||||
with:
|
|
||||||
path: /nix
|
|
||||||
key: "tclip-cache-v1"
|
|
||||||
|
|
||||||
- name: Install Nix
|
|
||||||
uses: https://github.com/cachix/install-nix-action@v22
|
|
||||||
with:
|
|
||||||
extra_nix_config: "experimental-features = nix-command flakes"
|
|
||||||
nix_path: nixpkgs=channel:nixos-23.05
|
|
||||||
- name: Remove access_tokens
|
|
||||||
run: sed -i '/^access-tokens/d' /etc/nix/nix.conf
|
|
||||||
- name: "Basic CLI and web build"
|
|
||||||
run: |
|
|
||||||
nix build .#tclip .#tclipd
|
|
||||||
|
|
||||||
- name: "Docker image build"
|
|
||||||
run: |
|
|
||||||
nix build .#docker
|
|
||||||
|
|
||||||
- name: Push image with Skopeo
|
|
||||||
run: |
|
|
||||||
nix-env -i skopeo -f '<nixpkgs>'
|
|
||||||
wget https://raw.githubusercontent.com/containers/skopeo/main/default-policy.json && mkdir /etc/containers && mv default-policy.json /etc/containers/policy.json
|
|
||||||
skopeo login --username arch --password $REGISTRY_TOKEN git.gmem.ca
|
|
||||||
skopeo copy docker-archive:result docker://git.gmem.ca/arch/tclip:arm
|
|
||||||
env:
|
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Portable service build"
|
|
||||||
run: |
|
|
||||||
nix build .#portable-service
|
|
||||||
mkdir -p var
|
|
||||||
cp ./result/*.raw ./var
|
|
||||||
- uses: https://github.com/actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: portable-service
|
|
||||||
path: ./var/*.raw
|
|
||||||
|
|
99
.github/workflows/nix.yaml
vendored
99
.github/workflows/nix.yaml
vendored
|
@ -5,40 +5,101 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
build-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: debian-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: cachix/install-nix-action@v18
|
- name: "Install prerequisites"
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y sudo zstd
|
||||||
|
- name: "Cache Nix store"
|
||||||
|
uses: actions/cache@v3.0.8
|
||||||
|
id: nix-cache
|
||||||
with:
|
with:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
path: /nix
|
||||||
|
key: "tclip-cache-v1"
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: https://github.com/cachix/install-nix-action@v22
|
||||||
|
with:
|
||||||
|
extra_nix_config: "experimental-features = nix-command flakes"
|
||||||
|
nix_path: nixpkgs=channel:nixos-23.05
|
||||||
|
- name: Remove access_tokens
|
||||||
|
run: sed -i '/^access-tokens/d' /etc/nix/nix.conf
|
||||||
- name: "Basic CLI and web build"
|
- name: "Basic CLI and web build"
|
||||||
run: |
|
run: |
|
||||||
nix build .#tclip .#tclipd
|
nix build .#tclip .#tclipd
|
||||||
|
|
||||||
- name: "Docker image build"
|
- name: "Docker image build"
|
||||||
run: |
|
run: |
|
||||||
nix build .#docker
|
nix build .#docker
|
||||||
docker load < ./result
|
|
||||||
- name: "docker login"
|
- name: Push image with Skopeo
|
||||||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
|
|
||||||
if: "github.event_name == 'push' && github.ref_name == 'main'"
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: "Docker image push"
|
|
||||||
if: "github.event_name == 'push' && github.ref_name == 'main'"
|
|
||||||
run: |
|
run: |
|
||||||
docker push ghcr.io/gmemstr//tclip:latest
|
nix-env -i skopeo -f '<nixpkgs>'
|
||||||
|
wget https://raw.githubusercontent.com/containers/skopeo/main/default-policy.json && mkdir /etc/containers && mv default-policy.json /etc/containers/policy.json
|
||||||
|
skopeo login --username arch --password $REGISTRY_TOKEN git.gmem.ca
|
||||||
|
skopeo copy docker-archive:result docker://git.gmem.ca/arch/tclip:latest
|
||||||
|
env:
|
||||||
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: "Portable service build"
|
- name: "Portable service build"
|
||||||
run: |
|
run: |
|
||||||
nix build .#portable-service
|
nix build .#portable-service
|
||||||
mkdir -p var
|
mkdir -p var
|
||||||
cp ./result/*.raw ./var
|
cp ./result/*.raw ./var
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: https://github.com/actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: portable-service
|
name: portable-service
|
||||||
path: ./var/*.raw
|
path: ./var/*.raw
|
||||||
|
|
||||||
|
build-docker-arm:
|
||||||
|
runs-on: debian-latest-arm
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: "Install prerequisites"
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y sudo zstd
|
||||||
|
- name: "Cache Nix store"
|
||||||
|
uses: actions/cache@v3.0.8
|
||||||
|
id: nix-cache
|
||||||
|
with:
|
||||||
|
path: /nix
|
||||||
|
key: "tclip-cache-v1"
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: https://github.com/cachix/install-nix-action@v22
|
||||||
|
with:
|
||||||
|
extra_nix_config: "experimental-features = nix-command flakes"
|
||||||
|
nix_path: nixpkgs=channel:nixos-23.05
|
||||||
|
- name: Remove access_tokens
|
||||||
|
run: sed -i '/^access-tokens/d' /etc/nix/nix.conf
|
||||||
|
- name: "Basic CLI and web build"
|
||||||
|
run: |
|
||||||
|
nix build .#tclip .#tclipd
|
||||||
|
|
||||||
|
- name: "Docker image build"
|
||||||
|
run: |
|
||||||
|
nix build .#docker
|
||||||
|
|
||||||
|
- name: Push image with Skopeo
|
||||||
|
run: |
|
||||||
|
nix-env -i skopeo -f '<nixpkgs>'
|
||||||
|
wget https://raw.githubusercontent.com/containers/skopeo/main/default-policy.json && mkdir /etc/containers && mv default-policy.json /etc/containers/policy.json
|
||||||
|
skopeo login --username arch --password $REGISTRY_TOKEN git.gmem.ca
|
||||||
|
skopeo copy docker-archive:result docker://git.gmem.ca/arch/tclip:arm
|
||||||
|
env:
|
||||||
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: "Portable service build"
|
||||||
|
run: |
|
||||||
|
nix build .#portable-service
|
||||||
|
mkdir -p var
|
||||||
|
cp ./result/*.raw ./var
|
||||||
|
- uses: https://github.com/actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: portable-service
|
||||||
|
path: ./var/*.raw
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue