This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sofastack/master
update master
- Loading branch information
Showing
372 changed files
with
13,124 additions
and
563 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Arkctl Release Action | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'version of current arkctl' | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
jobs: | ||
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 ls-remote --tags origin 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.is-tag-created == '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] | ||
goarch: ["386", amd64, arm64] | ||
exclude: | ||
- goarch: "386" | ||
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.3" | ||
project_path: "./arkctl" | ||
binary_name: "arkctl" | ||
asset_name: "arkctl-${{ github.event.inputs.version }}-${{ matrix.goos }}-${{ matrix.goarch }}" | ||
release_tag: "arkctl-release-${{ github.event.inputs.version }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Arkctl Unit Test | ||
run-name: ${{ github.actor }} pushed arkctl code | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'arkctl/**' | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- 'arkctl/**' | ||
|
||
# enable manually running the workflow | ||
workflow_dispatch: | ||
|
||
env: | ||
CGO_ENABLED: 0 | ||
GOOS: linux | ||
WORK_DIR: arkctl | ||
|
||
defaults: | ||
run: | ||
working-directory: arkctl | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.1' | ||
cache-dependency-path: ${{ env.WORK_DIR }}/go.sum | ||
|
||
- name: Run go mod | ||
run: go mod download | ||
|
||
- name: Test | ||
run: make test | ||
|
||
# https://about.codecov.io/blog/getting-started-with-code-coverage-for-golang/ | ||
- name: Upload coverage to CodeCov | ||
uses: codecov/codecov-action@v3 |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ docs/resources/ | |
docs/node_modules/ | ||
docs/package-lock.json | ||
docs/.hugo_build.lock | ||
docs/public | ||
*/coverage.out |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
test: | ||
go test ./... | ||
go test ./... | ||
|
||
.PHONY: test | ||
test: fmt vet ## Run tests. | ||
go test ./... -coverprofile=coverage.out | ||
|
||
.PHONY: fmt | ||
fmt: ## Run go fmt against code. | ||
go fmt ./... | ||
|
||
.PHONY: vet | ||
vet: ## Run go vet against code. | ||
go vet ./... |
Oops, something went wrong.