Improved labelling/outputs

This commit is contained in:
Tom Foster 2024-04-23 13:24:00 +01:00 committed by GitHub
parent 4d2053d250
commit 2a71457203
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,8 +25,8 @@ permissions:
contents: read contents: read
jobs: jobs:
setup: build_and_publish:
name: Setup Environment name: Build and publish artifacts
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Sync repository - name: Sync repository
@ -55,12 +55,9 @@ jobs:
echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf
- name: Populate `/nix/store` and package environment - name: Populate `/nix/store` and activate `direnv`
run: | run: |
nix develop --command true nix develop --command true
- name: Install and activate `direnv`
run: |
nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
touch $HOME/.direnvrc touch $HOME/.direnvrc
source $HOME/.direnvrc source $HOME/.direnvrc
@ -140,22 +137,17 @@ jobs:
path: target/aarch64-unknown-linux-musl-jemalloc.deb path: target/aarch64-unknown-linux-musl-jemalloc.deb
if-no-files-found: error if-no-files-found: error
- name: Build OCI images - name: Build OCI image targets
run: | run: |
/bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc /bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc
- name: Organise OCI outputs - name: Organise OCI image outputs
run: | run: |
mv result oci-image-x86_64-unknown-linux-musl.tar.gz mv result oci-image-x86_64-unknown-linux-musl.tar.gz
mv result-1 oci-image-x86_64-unknown-linux-musl-jemalloc.tar.gz mv result-1 oci-image-x86_64-unknown-linux-musl-jemalloc.tar.gz
mv result-2 oci-image-aarch64-unknown-linux-musl.tar.gz mv result-2 oci-image-aarch64-unknown-linux-musl.tar.gz
mv result-3 oci-image-aarch64-unknown-linux-musl-jemalloc.tar.gz mv result-3 oci-image-aarch64-unknown-linux-musl-jemalloc.tar.gz
- name: Build OCI for ${{ matrix.target }}
run: |
./bin/nix-build-and-cache .#oci-image-${{ matrix.target }}
cp -v -f result oci-image-${{ matrix.target }}.tar.gz
- name: Upload OCI image x86_64-unknown-linux-musl - name: Upload OCI image x86_64-unknown-linux-musl
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@ -202,7 +194,7 @@ jobs:
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push Manifest to GitHub - name: Create and push combined manifest to GitHub
run: | run: |
REPO_GHCR="ghcr.io/${{ github.repository }}" REPO_GHCR="ghcr.io/${{ github.repository }}"
SHA_TAG="${{ github.ref_name }}-${{ github.sha }}" SHA_TAG="${{ github.ref_name }}-${{ github.sha }}"
@ -231,7 +223,7 @@ jobs:
username: ${{ env.DOCKER_USERNAME }} username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }} password: ${{ env.DOCKERHUB_TOKEN }}
- name: Create and push manifest to Docker Hub - name: Create and push combined manifest to Docker Hub
env: env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }} DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}