ref_name:release-0.7 release_version:v0.7.1-beta.3 #325
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-VERSION | |
on: | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: 'The tag name of release' | |
required: true | |
default: '' | |
run-name: ref_name:${{ github.ref_name }} release_version:${{ inputs.release_version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
RELEASE_BOT_WEBHOOK: ${{ secrets.RELEASE_BOT_WEBHOOK }} | |
GO_VERSION: "1.21" | |
jobs: | |
release-message: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.get_trigger_mode.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: release message | |
id: get_trigger_mode | |
run: | | |
bash .github/utils/utils.sh --type 11 \ | |
--tag-name "${{ inputs.release_version }}" \ | |
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} | |
TEST_PACKAGES=`bash .github/utils/utils.sh --type 16 \ | |
--trigger-type "[test]" \ | |
--test-pkgs "${{ vars.TEST_PKGS }}" \ | |
--test-check "${{ vars.TEST_CHECK }}" \ | |
--test-pkgs-first "${{ vars.TEST_PKGS_FIRST }}" \ | |
--ignore-pkgs "${{ vars.SKIP_CHECK_PKG }}"` | |
echo "matrix={\"include\":[$TEST_PACKAGES]}" >> $GITHUB_OUTPUT | |
release-test: | |
needs: release-message | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: ${{ fromJSON(needs.release-message.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: install lib | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends \ | |
libbtrfs-dev \ | |
libdevmapper-dev | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "${{ env.GO_VERSION }}" | |
- name: Install golangci-lint | |
if: matrix.ops == 'lint' | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 | |
- name: make ${{ matrix.ops }} | |
if: ${{ ! contains(matrix.ops, '/') }} | |
run: | | |
make ${{ matrix.ops }} | |
- name: make test ${{ matrix.ops }} | |
if: ${{ contains(matrix.ops, '/') }} | |
run: | | |
make test TEST_PACKAGES=./${{ matrix.ops }}/... | |
release-version: | |
needs: release-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout branch ${{ github.ref_name }} | |
uses: actions/checkout@v4 | |
- name: push tag | |
uses: mathieudutour/[email protected] | |
with: | |
custom_tag: ${{ inputs.release_version }} | |
github_token: ${{ env.GITHUB_TOKEN }} | |
tag_prefix: "" | |
send-message: | |
runs-on: ubuntu-latest | |
needs: release-version | |
if: ${{ failure() || cancelled() }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: send message | |
run: | | |
bash .github/utils/utils.sh --type 12 \ | |
--tag-name ${{ inputs.release_version }} \ | |
--content "release\u00a0${{ inputs.release_version }}\u00a0error"\ | |
--bot-webhook ${{ env.RELEASE_BOT_WEBHOOK }} \ | |
--run-url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" |