Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #298 from CodeNoobKing/feat_ark_ci
Browse files Browse the repository at this point in the history
<feat> complete ark auto relase action
  • Loading branch information
lvjing2 authored Nov 15, 2023
2 parents 6f4ce96 + 349adf2 commit f7469db
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions .github/workflows/arkctl_release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Arkctl Release Action

on:
workflow_dispatch:
inputs:
Expand All @@ -10,9 +12,44 @@ permissions:
packages: write

jobs:
releases-matrix:
name: Release Go Binary
prepare:
name: Prepare for build
runs-on: ubuntu-latest
outputs:
is-tag-created: ${{ steps.check_tag.outputs.exists }}
steps:
- uses: actions/checkout@v3
- name: Check if Tag Exists
id: check_tag
run: |
TAG_EXISTS=$(git tag -l "arkctl-release-${{ github.event.inputs.version }}")
if [ -z "$TAG_EXISTS" ]; then
echo "exists=False" >> $GITHUB_OUTPUT
else
echo "exists=True" >> $GITHUB_OUTPUT
fi
create-tag:
name: Create for branch if empty
if: needs.prepare.outputs.created-tag == 'False'
runs-on: ubuntu-latest
needs: ['prepare']
steps:
- name: Output variable
run: echo "Created Branch ${{needs.prepare.outputs.is-tag-created}} ?"
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTIONS_RUNNER_DEBUG: true
with:
tag_name: arkctl-release-${{ github.event.inputs.version }}
release_name: Release arkctl ${{ github.event.inputs.version }} binary!

release:
name: Release binary
runs-on: ubuntu-latest
if: always()
needs: ['prepare', 'create-tag']
strategy:
matrix:
goos: [linux, windows, darwin]
Expand All @@ -22,15 +59,16 @@ jobs:
goos: darwin
- goarch: arm64
goos: windows

steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.21"
goversion: "1.21.3"
project_path: "./arkctl"
binary_name: "arkctl"
asset_name: "arkctl-${{ github.event.inputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}"
release_tag: "Release arkctl-${{ github.event.inputs.version }} !"
release_tag: "arkctl-release-${{ github.event.inputs.version }}"

0 comments on commit f7469db

Please sign in to comment.