chores: update release yaml #7
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: | |
branches: | |
- release-test | |
# tags: | |
# - 'v*' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [ yarn-operator ] | |
env: | |
ALIYUN_BJ_REG: registry.cn-beijing.aliyuncs.com | |
ALIYUN_HZ_REG: registry.cn-hangzhou.aliyuncs.com | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to AliyunCS_BJ | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.ALIYUN_BJ_REG }} | |
username: ${{ secrets.ALIYUN_USERNAME }} | |
password: ${{ secrets.ALIYUN_PWD }} | |
- name: Login to AliyunCS_HZ | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.ALIYUN_HZ_REG }} | |
username: ${{ secrets.ALIYUN_USERNAME }} | |
password: ${{ secrets.ALIYUN_PWD }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
pull: true | |
file: docker/${{ matrix.target }}.dockerfile | |
labels: | | |
org.opencontainers.image.title=${{ matrix.target }} | |
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
org.opencontainers.image.revision=${{ github.sha }} | |
org.opencontainers.image.created=${{ github.event.repository.updated_at}} | |
org.opencontainers.image.licenses=Apache-2.0 | |
tags: | | |
${{ env.ALIYUN_BJ_REG }}/${{ github.repository_owner }}/${{ matrix.target }}:${{ github.ref_name }} | |
${{ env.ALIYUN_HZ_REG }}/${{ github.repository_owner }}/${{ matrix.target }}:${{ github.ref_name }} | |
cache-from: type=gha,scope=build-${{ matrix.target }} | |
cache-to: type=gha,mode=max,scope=build-${{ matrix.target }} | |
goreleaser: | |
runs-on: ubuntu-latest | |
env: | |
ALIYUN_BJ_REG: registry.cn-beijing.aliyuncs.com | |
ALIYUN_HZ_REG: registry.cn-hangzhou.aliyuncs.com | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch all tags | |
run: git fetch --force --tags | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
cache: false | |
go-version-file: go.mod | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |