Skip to content

Merge pull request #184 from nats-io/release-2.10.21-RC.1 #28

Merge pull request #184 from nats-io/release-2.10.21-RC.1

Merge pull request #184 from nats-io/release-2.10.21-RC.1 #28

Workflow file for this run

name: Build Images
on:
push:
tags:
- "*"
env:
IMAGE_NAME: "synadia/nats-server"
LINUX_ARCHS: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/amd64,linux/386,linux/s390x,linux/ppc64le"
jobs:
linux-2_10:
name: Build Linux (2.10.x)
if: ${{ startsWith(github.ref_name, 'v2.10.') }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- name: Tag Version
id: ref
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"
- name: Alpine 3.20
uses: docker/build-push-action@v6
with:
context: ./2.10.x/alpine3.20/
platforms: ${{ env.LINUX_ARCHS }}
push: true
tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.20
provenance: mode=max
- name: Scratch
uses: docker/build-push-action@v6
with:
context: ./2.10.x/scratch/
file: ./2.10.x/scratch/Dockerfile.preview
platforms: ${{ env.LINUX_ARCHS }}
push: true
tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
provenance: mode=max
build-args: |
BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.20
windows-2019-2_10:
name: Build Windows (2.10.x)
if: ${{ startsWith(github.ref_name, 'v2.10.') }}
runs-on: windows-2019
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# NOTE: bash is supported on Windows runners
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- name: Tag Version
id: ref
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"
# Buildx is not supported on Windows yet.
- name: windowsservercore-1809
shell: pwsh
run: |
docker build `
--tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809" `
./2.10.x/windowsservercore-1809
docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809"
- name: nanoserver-1809
shell: pwsh
run: |
docker build `
--file ./2.10.x/nanoserver-1809/Dockerfile.preview `
--build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809" `
--tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-1809" `
./2.10.x/nanoserver-1809
docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-1809"
linux-2_11:
name: Build Linux (2.11.x)
if: ${{ startsWith(github.ref_name, 'v2.11.') }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Tag Version
id: ref
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"
- name: Alpine 3.20
uses: docker/build-push-action@v6
with:
context: ./2.11.x/alpine3.20/
platforms: ${{ env.LINUX_ARCHS }}
push: true
tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.20
provenance: mode=max
- name: Scratch
uses: docker/build-push-action@v6
with:
context: ./2.11.x/scratch/
file: ./2.11.x/scratch/Dockerfile.preview
platforms: ${{ env.LINUX_ARCHS }}
push: true
tags: ${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-scratch
provenance: mode=max
build-args: |
BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-alpine3.20
windows-2019-2_11:
name: Build Windows (2.11.x)
if: ${{ startsWith(github.ref_name, 'v2.11.') }}
runs-on: windows-2019
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# NOTE: bash is supported on Windows runners
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- name: Tag Version
id: ref
shell: bash
run: |
TAG=${{ github.ref_name }}
echo "TAG=${TAG#v}" >> "$GITHUB_OUTPUT"
# Buildx is not supported on Windows yet.
- name: windowsservercore-1809
shell: pwsh
run: |
docker build `
--tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809" `
./2.11.x/windowsservercore-1809
docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809"
- name: nanoserver-1809
shell: pwsh
run: |
docker build `
--file ./2.11.x/nanoserver-1809/Dockerfile.preview `
--build-arg "BASE_IMAGE=${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-windowsservercore-1809" `
--tag "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-1809" `
./2.11.x/nanoserver-1809
docker push "${{ env.IMAGE_NAME }}:${{ steps.ref.outputs.TAG }}-nanoserver-1809"