Improved CI artifact filename handling
This commit is contained in:
parent
49e453fe07
commit
d57110e2f3
1 changed files with 11 additions and 8 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
@ -25,8 +25,8 @@ permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
tests:
|
||||||
name: Prepare environment
|
name: Prepare and test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Sync repository
|
- name: Sync repository
|
||||||
|
@ -76,7 +76,8 @@ jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: setup
|
needs: tests
|
||||||
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -131,18 +132,19 @@ jobs:
|
||||||
mkdir -p target/release
|
mkdir -p target/release
|
||||||
cp -v -f result/bin/conduit target/release/
|
cp -v -f result/bin/conduit target/release/
|
||||||
direnv exec . cargo deb --no-build --no-strip --output target/debian/${{ matrix.target }}.deb
|
direnv exec . cargo deb --no-build --no-strip --output target/debian/${{ matrix.target }}.deb
|
||||||
|
mv target/release/conduit static-${{ matrix.target }}
|
||||||
|
|
||||||
- name: Upload static-${{ matrix.target }}
|
- name: Upload static-${{ matrix.target }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: static-${{ matrix.target }}
|
name: static-${{ matrix.target }}
|
||||||
path: result/bin/conduit
|
path: static-${{ matrix.target }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload deb ${{ matrix.target }}
|
- name: Upload deb ${{ matrix.target }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.target }}.deb
|
name: deb-${{ matrix.target }}
|
||||||
path: target/debian/${{ matrix.target }}.deb
|
path: target/debian/${{ matrix.target }}.deb
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
@ -154,7 +156,7 @@ jobs:
|
||||||
- name: Upload OCI image ${{ matrix.target }}
|
- name: Upload OCI image ${{ matrix.target }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: oci-image-${{ matrix.target }}.tar.gz
|
name: oci-image-${{ matrix.target }}
|
||||||
path: oci-image-${{ matrix.target }}.tar.gz
|
path: oci-image-${{ matrix.target }}.tar.gz
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
@ -170,6 +172,7 @@ jobs:
|
||||||
|
|
||||||
- name: Load OCI Images and tag
|
- name: Load OCI Images and tag
|
||||||
run: |
|
run: |
|
||||||
|
mv oci-image-*/*.tar.gz .
|
||||||
ID_AARCH64=$(docker load -i oci-image-aarch64-unknown-linux-musl-jemalloc.tar.gz | sed -n 's/Loaded image: \(.*\)/\1/p')
|
ID_AARCH64=$(docker load -i oci-image-aarch64-unknown-linux-musl-jemalloc.tar.gz | sed -n 's/Loaded image: \(.*\)/\1/p')
|
||||||
docker tag $ID_AARCH64 conduwuit:${{ github.sha }}-aarch64-jemalloc
|
docker tag $ID_AARCH64 conduwuit:${{ github.sha }}-aarch64-jemalloc
|
||||||
ID_X86_64=$(docker load -i oci-image-x86_64-unknown-linux-musl-jemalloc.tar.gz | sed -n 's/Loaded image: \(.*\)/\1/p')
|
ID_X86_64=$(docker load -i oci-image-x86_64-unknown-linux-musl-jemalloc.tar.gz | sed -n 's/Loaded image: \(.*\)/\1/p')
|
||||||
|
@ -190,7 +193,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_USERNAME: ${{ github.repository_owner }}
|
GITHUB_USERNAME: ${{ github.repository_owner }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
if: ${{ (env.GITHUB_USERNAME != '') && (env.GITHUB_TOKEN != '') }}
|
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && (github.event_name != 'pull_request') && (env.GITHUB_USERNAME != '') && (env.GITHUB_TOKEN != '') }}
|
||||||
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 }}"
|
||||||
|
@ -223,7 +226,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
|
DOCKER_USERNAME: ${{ vars.DOCKER_USERNAME }}
|
||||||
if: ${{ (env.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
|
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && (github.event_name != 'pull_request') && (env.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }}
|
||||||
run: |
|
run: |
|
||||||
REPO_DOCKER="docker.io/${{ github.repository }}"
|
REPO_DOCKER="docker.io/${{ github.repository }}"
|
||||||
SHA_TAG="${{ github.ref_name }}-${{ github.sha }}"
|
SHA_TAG="${{ github.ref_name }}-${{ github.sha }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue