blob: b25ea64cd0513ce8b7d82a701f08cd43c04b56ec [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: Dubbo ctl Release
on:
release:
types: [create, published]
jobs:
release:
permissions:
contents: write
name: Release Dubbo
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'dubbo/')
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [386, amd64, arm64]
exclude:
- goos: darwin
goarch: 386
steps:
- uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Download dependencies
run: |
go mod download
- name: Prepare build directory
run: |
mkdir -p build/
cp README.md build/
cp LICENSE build/
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
make build-dubboctl
make build-dubbocp
cp -r conf build/conf
mv bin/dubboctl build/dubboctl
mv bin/dubbo-cp build/dubbo-cp
- name: Rename on windows
if: matrix.goos == 'windows'
run: |
mv build/dubboctl build/dubboctl.exe
mv build/dubbo-cp build/dubbo-cp.exe
- name: Create package
id: package
run: |
PACKAGE_NAME=dubbo-${GITHUB_REF#refs/tags/dubbo/}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
tar -czvf $PACKAGE_NAME -C build .
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.package.outputs.name }}
asset_name: ${{ steps.package.outputs.name }}
asset_content_type: application/gzip