chore: prepare release 1.4.3 #122
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
version: | |
name: Set Version from git ref | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- id: version | |
run: echo "::set-output name=version::$(sed 's#^refs/tags/\(.*\)#\1#' <<< '${{ github.ref }}')" | |
binaries: | |
name: Binaries | |
runs-on: ubuntu-latest | |
needs: version | |
env: | |
VERSION: ${{ needs.version.outputs.version }} | |
BUILD_DATE: '$$(date +%Y-%m-%d-%H:%M)' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Build Binaries | |
run: | | |
make release-artifacts | |
- name: Generate Release Notes | |
run: scripts/release-notes.sh $VERSION > release-notes.md | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
tag: ${{ env.VERSION }} | |
name: ${{ env.VERSION }} | |
bodyFile: "release-notes.md" | |
prerelease: ${{ contains(env.VERSION, '-alpha.') || contains(env.VERSION, '-beta.') || contains(env.VERSION, '-rc.') || contains(env.VERSION, '-nightly.') }} | |
- name: Upload macOS (amd64).zip | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-darwin-amd64.zip" | |
asset_name: "fsm-${{ env.VERSION }}-darwin-amd64.zip" | |
asset_content_type: application/zip | |
- name: Upload macOS (amd64).tar.gz | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-darwin-amd64.tar.gz" | |
asset_name: "fsm-${{ env.VERSION }}-darwin-amd64.tar.gz" | |
asset_content_type: application/gzip | |
- name: Upload macOS (arm64).zip | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-darwin-arm64.zip" | |
asset_name: "fsm-${{ env.VERSION }}-darwin-arm64.zip" | |
asset_content_type: application/zip | |
- name: Upload macOS (arm64).tar.gz | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-darwin-arm64.tar.gz" | |
asset_name: "fsm-${{ env.VERSION }}-darwin-arm64.tar.gz" | |
asset_content_type: application/gzip | |
- name: Upload Linux (amd64).zip | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-linux-amd64.zip" | |
asset_name: "fsm-${{ env.VERSION }}-linux-amd64.zip" | |
asset_content_type: application/zip | |
- name: Upload Linux (amd64).tar.gz | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-linux-amd64.tar.gz" | |
asset_name: "fsm-${{ env.VERSION }}-linux-amd64.tar.gz" | |
asset_content_type: application/gzip | |
- name: Upload Linux (arm64).zip | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-linux-arm64.zip" | |
asset_name: "fsm-${{ env.VERSION }}-linux-arm64.zip" | |
asset_content_type: application/zip | |
- name: Upload Linux (arm64).tar.gz | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "_dist/fsm-${{ env.VERSION }}-linux-arm64.tar.gz" | |
asset_name: "fsm-${{ env.VERSION }}-linux-arm64.tar.gz" | |
asset_content_type: application/gzip | |
- name: Upload Checksums | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: _dist/sha256sums.txt | |
asset_name: sha256sums.txt | |
asset_content_type: text/plain | |
images: | |
name: Docker Images | |
runs-on: ubuntu-latest | |
needs: version | |
env: | |
VERSION: ${{ needs.version.outputs.version }} | |
BUILD_DATE_VAR: 'github.com/flomesh-io/fsm/pkg/version.BuildDate' | |
BUILD_VERSION_VAR: 'github.com/flomesh-io/fsm/pkg/version.Version' | |
BUILD_GITCOMMIT_VAR: 'github.com/flomesh-io/fsm/pkg/version.GitCommit' | |
strategy: | |
matrix: | |
id: [ "curl", "sidecar-init", "controller", "injector", "connector", "crds", "bootstrap", "preinstall", "healthcheck", "interceptor", "ingress", "gateway" ] | |
steps: | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.RELEASE_DOCKER_USER }} | |
password: ${{ secrets.RELEASE_DOCKER_PASS }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Package Helm Charts | |
run: make charts-tgz | |
- name: Docker meta - ${{ matrix.id }} | |
id: docker_meta | |
uses: crazy-max/[email protected] | |
with: | |
images: ${{ secrets.RELEASE_REGISTRY }}/fsm-${{ matrix.id }} | |
tags: | | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}}.{{minor}}.{{patch}} | |
type=sha,format=short | |
flavor: | | |
latest=auto | |
- name: Get Build Info | |
run: | | |
echo "BUILD_DATE=$(date +%Y-%m-%d-%H:%M)" >> $GITHUB_ENV | |
echo "GIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
- name: Build and Push - ${{ matrix.id }} | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./dockerfiles/Dockerfile.fsm-${{ matrix.id }} | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
GO_VERSION=1.23 | |
LDFLAGS=-X ${{ env.BUILD_DATE_VAR }}=${{ env.BUILD_DATE }} -X ${{ env.BUILD_VERSION_VAR }}=${{ env.VERSION }} -X ${{ env.BUILD_GITCOMMIT_VAR }}=${{ env.GIT_SHA }} -s -w | |
DISTROLESS_TAG=nonroot | |
push: ${{ (github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) )) }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
demo-images: | |
name: Demo Docker Images | |
runs-on: ubuntu-latest | |
needs: version | |
strategy: | |
matrix: | |
id: [ "bookbuyer", "bookthief", "bookstore", "bookwarehouse", "tcp-echo-server", "tcp-client" ] | |
steps: | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Login to DockerHub | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.RELEASE_DOCKER_USER }} | |
password: ${{ secrets.RELEASE_DOCKER_PASS }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Docker meta - ${{ matrix.id }} | |
id: docker_meta | |
uses: crazy-max/[email protected] | |
with: | |
images: ${{ secrets.RELEASE_REGISTRY }}/fsm-demo-${{ matrix.id }} | |
tags: | | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}}.{{minor}}.{{patch}} | |
type=sha,format=short | |
flavor: | | |
latest=auto | |
- name: Build and Push - ${{ matrix.id }} | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./dockerfiles/Dockerfile.demo | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
GO_VERSION=1.23 | |
BINARY=${{ matrix.id }} | |
push: ${{ (github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == format('refs/heads/{0}', github.event.repository.default_branch) )) }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} |