mirror of
https://github.com/nushell/nushell
synced 2025-01-26 11:55:20 +00:00
Merge pull request #806 from DrSensor/ci/github/quay.io
ci(github): replace docker.pkg.github.com with quay.io
This commit is contained in:
commit
11e4410d1c
2 changed files with 46 additions and 26 deletions
70
.github/workflows/docker-publish.yml
vendored
70
.github/workflows/docker-publish.yml
vendored
|
@ -2,7 +2,7 @@ name: Publish consumable Docker images
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ['*.*.*']
|
tags: ['v?[0-9]+.[0-9]+.[0-9]+*']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile:
|
compile:
|
||||||
|
@ -14,7 +14,11 @@ jobs:
|
||||||
- x86_64-unknown-linux-gnu
|
- x86_64-unknown-linux-gnu
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- run: cargo install cross
|
- name: Install rust-embedded/cross
|
||||||
|
env: { VERSION: v0.1.16 }
|
||||||
|
run: >-
|
||||||
|
wget -nv https://github.com/rust-embedded/cross/releases/download/${VERSION}/cross-${VERSION}-x86_64-unknown-linux-gnu.tar.gz
|
||||||
|
-O- | sudo tar xz -C /usr/local/bin/
|
||||||
- name: compile for specific target
|
- name: compile for specific target
|
||||||
env: { arch: '${{ matrix.arch }}' }
|
env: { arch: '${{ matrix.arch }}' }
|
||||||
run: |
|
run: |
|
||||||
|
@ -31,6 +35,10 @@ jobs:
|
||||||
name: Build and publish docker images
|
name: Build and publish docker images
|
||||||
needs: compile
|
needs: compile
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: quay.io/nushell
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_REGISTRY }}
|
||||||
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
tag:
|
tag:
|
||||||
|
@ -58,41 +66,53 @@ jobs:
|
||||||
- uses: actions/download-artifact@master
|
- uses: actions/download-artifact@master
|
||||||
with: { name: '${{ matrix.arch }}', path: target/release }
|
with: { name: '${{ matrix.arch }}', path: target/release }
|
||||||
- name: Build and publish exact version
|
- name: Build and publish exact version
|
||||||
run: |
|
run: |-
|
||||||
REGISTRY=${REGISTRY,,}; export TAG=${GITHUB_REF##*/}-${{ matrix.tag }};
|
export DOCKER_TAG=${GITHUB_REF##*/}-${{ matrix.tag }}
|
||||||
export NU_BINS=target/release/$( [ ${{ matrix.plugin }} = true ] && echo nu* || echo nu )
|
export NU_BINS=target/release/$( [ ${{ matrix.plugin }} = true ] && echo nu* || echo nu )
|
||||||
export PATCH=$([ ${{ matrix.use-patch }} = true ] && echo .${{ matrix.tag }} || echo '')
|
export PATCH=$([ ${{ matrix.use-patch }} = true ] && echo .${{ matrix.tag }} || echo '')
|
||||||
chmod +x $NU_BINS
|
chmod +x $NU_BINS
|
||||||
|
|
||||||
echo ${{ secrets.DOCKER_REGISTRY }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
echo ${DOCKER_PASSWORD} | docker login ${DOCKER_REGISTRY} -u ${DOCKER_USER} --password-stdin
|
||||||
docker-compose --file docker/docker-compose.package.yml build
|
docker-compose --file docker/docker-compose.package.yml build
|
||||||
docker-compose --file docker/docker-compose.package.yml push # exact version
|
docker-compose --file docker/docker-compose.package.yml push # exact version
|
||||||
env:
|
env:
|
||||||
BASE_IMAGE: ${{ matrix.base-image }}
|
BASE_IMAGE: ${{ matrix.base-image }}
|
||||||
REGISTRY: docker.pkg.github.com/${{ github.repository }}
|
|
||||||
|
|
||||||
#region semantics tagging
|
#region semantics tagging
|
||||||
- name: Retag and push without suffixing version
|
- name: Retag and push with suffixed version
|
||||||
run: |
|
run: |-
|
||||||
VERSION=${GITHUB_REF##*/}
|
VERSION=${GITHUB_REF##*/}
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${{ matrix.tag }}
|
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${VERSION%%.*}-${{ matrix.tag }}
|
latest_version=${VERSION%%%.*}-${{ matrix.tag }}
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${VERSION%.*}-${{ matrix.tag }}
|
latest_feature=${VERSION%%.*}-${{ matrix.tag }}
|
||||||
docker push ${REGISTRY,,}/nu:${VERSION%.*}-${{ matrix.tag }} # latest patch
|
latest_patch=${VERSION%.*}-${{ matrix.tag }}
|
||||||
docker push ${REGISTRY,,}/nu:${VERSION%%.*}-${{ matrix.tag }} # latest features
|
exact_version=${VERSION}-${{ matrix.tag }}
|
||||||
docker push ${REGISTRY,,}/nu:${{ matrix.tag }} # latest version
|
|
||||||
env: { REGISTRY: 'docker.pkg.github.com/${{ github.repository }}' }
|
tags=( ${latest_version} ${latest_feature} ${latest_patch} ${exact_version} )
|
||||||
|
|
||||||
|
for tag in ${tags[@]}; do
|
||||||
|
docker tag ${DOCKER_REGISTRY}/nu:${VERSION}-${{ matrix.tag }} ${DOCKER_REGISTRY}/nu:${tag}
|
||||||
|
docker push ${DOCKER_REGISTRY}/nu:${tag}
|
||||||
|
done
|
||||||
|
|
||||||
|
# latest version
|
||||||
|
docker tag ${DOCKER_REGISTRY}/nu:${VERSION}-${{ matrix.tag }} ${DOCKER_REGISTRY}/nu:${{ matrix.tag }}
|
||||||
|
docker push ${DOCKER_REGISTRY}/nu:${{ matrix.tag }}
|
||||||
|
|
||||||
- name: Retag and push debian as latest
|
- name: Retag and push debian as latest
|
||||||
if: matrix.tag == 'debian'
|
if: matrix.tag == 'debian'
|
||||||
run: |
|
run: |-
|
||||||
VERSION=${GITHUB_REF##*/}
|
VERSION=${GITHUB_REF##*/}
|
||||||
docker tag ${REGISTRY,,}/nu:${{ matrix.tag }} ${REGISTRY,,}/nu:latest
|
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${VERSION%.*}
|
# ${latest features} ${latest patch} ${exact version}
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${VERSION%%.*}
|
tags=( ${VERSION%%.*} ${VERSION%.*} ${VERSION} )
|
||||||
docker tag ${REGISTRY,,}/nu:${VERSION}-${{ matrix.tag }} ${REGISTRY,,}/nu:${VERSION}
|
|
||||||
docker push ${REGISTRY,,}/nu:${VERSION} # exact version
|
for tag in ${tags[@]}; do
|
||||||
docker push ${REGISTRY,,}/nu:${VERSION%%.*} # latest features
|
docker tag ${DOCKER_REGISTRY}/nu:${VERSION}-${{ matrix.tag }} ${DOCKER_REGISTRY}/nu:${tag}
|
||||||
docker push ${REGISTRY,,}/nu:${VERSION%.*} # latest patch
|
docker push ${DOCKER_REGISTRY}/nu:${tag}
|
||||||
docker push ${REGISTRY,,}/nu:latest # latest version
|
done
|
||||||
env: { REGISTRY: 'docker.pkg.github.com/${{ github.repository }}' }
|
|
||||||
|
# latest version
|
||||||
|
docker tag ${DOCKER_REGISTRY}/nu:${{ matrix.tag }} ${DOCKER_REGISTRY}/nu:latest
|
||||||
|
docker push ${DOCKER_REGISTRY}/nu:latest
|
||||||
#endregion semantics tagging
|
#endregion semantics tagging
|
||||||
|
|
|
@ -2,7 +2,7 @@ version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nushell:
|
nushell:
|
||||||
image: ${REGISTRY}/nu:${TAG}
|
image: ${DOCKER_REGISTRY}/nu:${DOCKER_TAG}
|
||||||
build:
|
build:
|
||||||
context: ..
|
context: ..
|
||||||
dockerfile: docker/Package${PATCH}.Dockerfile
|
dockerfile: docker/Package${PATCH}.Dockerfile
|
||||||
|
|
Loading…
Reference in a new issue