Skip to content

Release qshell

Release qshell #49

Workflow file for this run

on:
release:
types: [published]
env:
CGO_ENABLED: 0
name: Release qshell
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
strategy:
max-parallel: 1
matrix:
include:
# macOS targets
- goarch: amd64
goos: darwin
- goarch: arm64
goos: darwin
# Linux targets
- goarch: "386"
goos: linux
- goarch: amd64
goos: linux
- goarch: arm
goos: linux
- goarch: arm64
goos: linux
- goarch: mips
goos: linux
- goarch: mipsle
goos: linux
- goarch: mips64
goos: linux
- goarch: mips64le
goos: linux
- goarch: loong64
goos: linux
- goarch: riscv64
goos: linux
# Windows targets
- goarch: "386"
goos: windows
- goarch: amd64
goos: windows
- goarch: arm
goos: windows
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v4
- name: Set APP_VERSION env
run: echo ::set-env name=APP_VERSION::$(cat ${GITHUB_EVENT_PATH} | jq -r .release.tag_name )
- name: Prepare qshell
run: |
set -e
wget -qLO /tmp/qshell-v2.11.0-linux-amd64.tar.gz https://devtools.qiniu.com/qshell-v2.11.0-linux-amd64.tar.gz
tar xf /tmp/qshell-v2.11.0-linux-amd64.tar.gz
rm /tmp/qshell-v2.11.0-linux-amd64.tar.gz
./qshell account -- "$PUBLISH_ACCESS_KEY" "$PUBLISH_SECRET_KEY" default
env:
PUBLISH_ACCESS_KEY: ${{ secrets.PUBLISH_ACCESS_KEY }}
PUBLISH_SECRET_KEY: ${{ secrets.PUBLISH_SECRET_KEY }}
- uses: wangyoucao577/go-release-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://go.dev/dl/go1.23.2.linux-amd64.tar.gz"
ldflags: -X "github.com/qiniu/qshell/v2/iqshell/common/version.version=${{ env.APP_VERSION }}" -extldflags "-static"
project_path: "./main"
retry: '100'
- name: Upload Release Asset to Qiniu
run: |
set -e
cd ./main/
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
if [ "${{ matrix.goos }}" = "windows" ]; then
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.zip"
fi
../qshell rput --resumable-api-v2 --overwrite "$PUBLISH_BUCKET_NAME" "$FILENAME" "$FILENAME"
env:
PUBLISH_BUCKET_NAME: ${{ secrets.PUBLISH_BUCKET_NAME }}