chore: add release-beta workflow #2
Workflow file for this run
This file contains hidden or 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: release-beta | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v2.0.[0-9]+-beta.[0-9]+' | ||
| jobs: | ||
| docker-amd64: | ||
| name: Docker beta release (amd64) | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| # https://github.com/actions/runner-images/issues/2840 | ||
| - name: Free disk space | ||
| run: | | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android/sdk/build-tools | ||
| sudo rm -rf /usr/local/lib/android/sdk/cmake | ||
| sudo rm -rf /usr/local/lib/android/sdk/cmdline-tools | ||
| sudo rm -rf /usr/local/lib/android/sdk/extras | ||
| sudo rm -rf /usr/local/lib/android/sdk/ndk | ||
| - | ||
| name: Login to ghcr.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - | ||
| name: Login to DockerHub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - | ||
| name: QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - | ||
| name: Metadata (base) | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| joseluisq/rust-linux-darwin-builder | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder | ||
| flavor: | | ||
| latest=false | ||
| suffix=-amd64 | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{version}}-amd64 | ||
| - | ||
| name: Setup (base) | ||
| uses: docker/setup-buildx-action@v3 | ||
| - | ||
| name: Build (base) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64 | ||
| file: docker/amd64/base/Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta.outputs.version }} | ||
| push: false | ||
| load: true | ||
| cache-from: type=gha,scope=devel-amd64 | ||
| cache-to: type=gha,scope=devel-amd64,mode=max | ||
| - | ||
| name: Inspect (base) | ||
| run: | | ||
| docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} | ||
| - | ||
| name: Tests (base) | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}" | ||
| shell: bash | ||
| options: -v ${{ github.workspace }}:/root/src | ||
| run: | | ||
| set -eux | ||
| cat /etc/debian_version | ||
| uname -a | ||
| make test-app | ||
| - | ||
| name: Push (base) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64 | ||
| file: docker/amd64/base/Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta.outputs.version }} | ||
| push: true | ||
| provenance: false | ||
| cache-from: type=gha,scope=devel-amd64 | ||
| cache-to: type=gha,scope=devel-amd64,mode=max | ||
| - | ||
| name: Manifest (base) | ||
| run: | | ||
| docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} | ||
| ## AMD64 libs | ||
| - | ||
| name: Metadata (libs) | ||
| id: meta2 | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| joseluisq/rust-linux-darwin-builder | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder | ||
| flavor: | | ||
| latest=false | ||
| suffix=-libs-amd64 | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{version}}-libs-amd64 | ||
| - | ||
| name: Setup (libs) | ||
| uses: docker/setup-buildx-action@v3 | ||
| - | ||
| name: Build (libs) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64 | ||
| file: docker/amd64/libs/Dockerfile | ||
| tags: ${{ steps.meta2.outputs.tags }} | ||
| labels: ${{ steps.meta2.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta2.outputs.version }} | ||
| push: false | ||
| load: true | ||
| cache-from: | | ||
| type=gha,scope=devel-libs-amd64 | ||
| type=gha,scope=devel-amd64 | ||
| cache-to: type=gha,scope=devel-libs-amd64,mode=max | ||
| - | ||
| name: Inspect (libs) | ||
| run: | | ||
| docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }} | ||
| - | ||
| name: Tests (libs) | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }}" | ||
| shell: bash | ||
| options: -v ${{ github.workspace }}:/root/src | ||
| run: | | ||
| set -eux | ||
| cat /etc/debian_version | ||
| uname -a | ||
| make test-app | ||
| make test-zlib | ||
| make test-openssl | ||
| - | ||
| name: Push (libs) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/amd64 | ||
| file: docker/amd64/libs/Dockerfile | ||
| tags: ${{ steps.meta2.outputs.tags }} | ||
| labels: ${{ steps.meta2.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta2.outputs.version }} | ||
| push: true | ||
| provenance: false | ||
| cache-from: | | ||
| type=gha,scope=devel-libs-amd64 | ||
| type=gha,scope=devel-amd64 | ||
| cache-to: type=gha,scope=devel-libs-amd64,mode=max | ||
| - | ||
| name: Manifest (libs) | ||
| run: | | ||
| docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }} | ||
| docker-arm64: | ||
| name: Docker beta release (arm64) | ||
| runs-on: ubuntu-22.04-arm | ||
| steps: | ||
| - | ||
| name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
| # https://github.com/actions/runner-images/issues/2840 | ||
| - name: Free disk space | ||
| run: | | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /usr/local/lib/android/sdk/build-tools | ||
| sudo rm -rf /usr/local/lib/android/sdk/cmake | ||
| sudo rm -rf /usr/local/lib/android/sdk/cmdline-tools | ||
| sudo rm -rf /usr/local/lib/android/sdk/extras | ||
| sudo rm -rf /usr/local/lib/android/sdk/ndk | ||
| - | ||
| name: Login to ghcr.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - | ||
| name: Login to DockerHub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - | ||
| name: QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| - | ||
| name: Metadata (base) | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| joseluisq/rust-linux-darwin-builder | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder | ||
| flavor: | | ||
| latest=false | ||
| suffix=-arm64 | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{version}}-arm64 | ||
| - | ||
| name: Setup (base) | ||
| uses: docker/setup-buildx-action@v3 | ||
| - | ||
| name: Build (base) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/arm64 | ||
| file: docker/arm64/base/Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta.outputs.version }} | ||
| push: false | ||
| load: true | ||
| cache-from: type=gha,scope=devel-arm64 | ||
| cache-to: type=gha,scope=devel-arm64,mode=max | ||
| - | ||
| name: Inspect (base) | ||
| run: | | ||
| docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} | ||
| - | ||
| name: Tests (base) | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}" | ||
| shell: bash | ||
| options: -v ${{ github.workspace }}:/root/src | ||
| run: | | ||
| set -eux | ||
| cat /etc/debian_version | ||
| uname -a | ||
| make test-app | ||
| - | ||
| name: Push (base) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/arm64 | ||
| file: docker/arm64/base/Dockerfile | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta.outputs.version }} | ||
| push: true | ||
| provenance: false | ||
| cache-from: type=gha,scope=devel-arm64 | ||
| cache-to: type=gha,scope=devel-arm64,mode=max | ||
| - | ||
| name: Manifest (base) | ||
| run: | | ||
| docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} | ||
| ## ARM64 libs | ||
| - | ||
| name: Metadata (libs) | ||
| id: meta2 | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| joseluisq/rust-linux-darwin-builder | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder | ||
| flavor: | | ||
| latest=false | ||
| suffix=-libs-arm64 | ||
| tags: | | ||
| type=semver,pattern={{version}} | ||
| type=semver,pattern={{version}}-libs-arm64 | ||
| - | ||
| name: Setup (libs) | ||
| uses: docker/setup-buildx-action@v3 | ||
| - | ||
| name: Build (libs) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/arm64 | ||
| file: docker/arm64/libs/Dockerfile | ||
| tags: ${{ steps.meta2.outputs.tags }} | ||
| labels: ${{ steps.meta2.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta2.outputs.version }} | ||
| push: false | ||
| load: true | ||
| cache-from: | | ||
| type=gha,scope=devel-libs-arm64 | ||
| type=gha,scope=devel-arm64 | ||
| cache-to: type=gha,scope=devel-libs-arm64,mode=max | ||
| - | ||
| name: Inspect (libs) | ||
| run: | | ||
| docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }} | ||
| - | ||
| name: Tests (libs) | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }}" | ||
| shell: bash | ||
| options: -v ${{ github.workspace }}:/root/src | ||
| run: | | ||
| set -eux | ||
| cat /etc/debian_version | ||
| uname -a | ||
| make test-app | ||
| make test-zlib | ||
| make test-openssl | ||
| - | ||
| name: Push (libs) | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| platforms: linux/arm64 | ||
| file: docker/arm64/libs/Dockerfile | ||
| tags: ${{ steps.meta2.outputs.tags }} | ||
| labels: ${{ steps.meta2.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ steps.meta2.outputs.version }} | ||
| push: true | ||
| provenance: false | ||
| cache-from: | | ||
| type=gha,scope=devel-libs-arm64 | ||
| type=gha,scope=devel-arm64 | ||
| cache-to: type=gha,scope=devel-libs-arm64,mode=max | ||
| - | ||
| name: Manifest (libs) | ||
| run: | | ||
| docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta2.outputs.version }} | ||
| manifest: | ||
| name: Docker beta release (manifest) | ||
| needs: | ||
| - docker-amd64 | ||
| - docker-arm64 | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Set envs | ||
| run: | | ||
| github_ref=${GITHUB_REF#refs/tags/} | ||
| SEMVER=${github_ref##*v} | ||
| echo "SEMVER=${SEMVER}" >> $GITHUB_ENV | ||
| echo $SEMVER | ||
| - | ||
| name: Login to ghcr.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - | ||
| name: Login to DockerHub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - | ||
| name: Pull all images | ||
| run: | | ||
| docker pull joseluisq/rust-linux-darwin-builder:$SEMVER-amd64 | ||
| docker pull joseluisq/rust-linux-darwin-builder:$SEMVER-arm64 | ||
| docker pull ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-amd64 | ||
| docker pull ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-arm64 | ||
| docker pull joseluisq/rust-linux-darwin-builder:$SEMVER-libs-amd64 | ||
| docker pull joseluisq/rust-linux-darwin-builder:$SEMVER-libs-arm64 | ||
| docker pull ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs-amd64 | ||
| docker pull ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs-arm64 | ||
| - | ||
| name: Push semver alias | ||
| run: | | ||
| docker manifest create \ | ||
| joseluisq/rust-linux-darwin-builder:$SEMVER \ | ||
| --amend joseluisq/rust-linux-darwin-builder:$SEMVER-amd64 \ | ||
| --amend joseluisq/rust-linux-darwin-builder:$SEMVER-arm64 | ||
| docker manifest push joseluisq/rust-linux-darwin-builder:$SEMVER | ||
| docker manifest create \ | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER \ | ||
| --amend ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-amd64 \ | ||
| --amend ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-arm64 | ||
| docker manifest push ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER | ||
| docker manifest create \ | ||
| joseluisq/rust-linux-darwin-builder:$SEMVER-libs \ | ||
| --amend joseluisq/rust-linux-darwin-builder:$SEMVER-libs-amd64 \ | ||
| --amend joseluisq/rust-linux-darwin-builder:$SEMVER-libs-arm64 | ||
| docker manifest push joseluisq/rust-linux-darwin-builder:$SEMVER-libs | ||
| docker manifest create \ | ||
| ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs \ | ||
| --amend ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs-amd64 \ | ||
| --amend ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs-arm64 | ||
| docker manifest push ghcr.io/joseluisq/rust-linux-darwin-builder:$SEMVER-libs | ||