-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
703 changed files
with
9,757 additions
and
318,326 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,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gomod | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
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,52 @@ | ||
name: "Unit/Coverage Tests" | ||
|
||
on: pull_request_target | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Run unit tests and coverage test | ||
id: test-coverage | ||
run: | | ||
go test -cover -v > output.txt | ||
- name: Transform output | ||
id: results | ||
if: always() | ||
run: | | ||
CONTENT=$(cat output.txt) | ||
CONTENT="${CONTENT//'%'/'%25'}" | ||
CONTENT="${CONTENT//$'\n'/'%0A'}" | ||
CONTENT="${CONTENT//$'\r'/'%0D'}" | ||
echo "::set-output name=content::$CONTENT" | ||
- name: Add Comment | ||
uses: actions/github-script@v5 | ||
if: always() | ||
with: | ||
script: | | ||
const output = `### Unit Tests and Coverage | ||
<details><summary>Show Output</summary> | ||
\`\`\` | ||
${{ steps.results.outputs.content }} | ||
\`\`\` | ||
</details> | ||
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: output | ||
}) |
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,47 @@ | ||
name: Checks | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
Golangci-Lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Install dependencies | ||
run: | | ||
go version | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
- name: Run golangci-lint | ||
run: | | ||
golangci-lint run cmd/... | ||
Go-Fmt: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.20" | ||
|
||
- name: Run fmt | ||
run: | | ||
gofmt_files=$(gofmt -l cmd) | ||
if [[ -n ${gofmt_files} ]]; then | ||
echo 'gofmt needs running on the following files:' | ||
echo "${gofmt_files}" | ||
exit 1 | ||
fi | ||
exit 0 |
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,18 @@ | ||
name: notify-issue | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
|
||
jobs: | ||
issue: | ||
runs-on: ubuntu-latest | ||
name: New Issue Notification | ||
steps: | ||
- run: | | ||
echo "{\"text\":\"Vultr-CLI : New Issue https://github.com/vultr/vultr-cli/issues/${{ github.event.issue.number }} \"}" > mattermost.json | ||
- uses: mattermost/action-mattermost-notify@master | ||
env: | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | ||
MATTERMOST_USERNAME: ${{ secrets.MATTERMOST_USERNAME}} | ||
MATTERMOST_ICON: ${{ secrets.MATTERMOST_ICON }} |
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,16 @@ | ||
name: notify-pr | ||
|
||
on: pull_request_target | ||
|
||
jobs: | ||
pr: | ||
runs-on: ubuntu-latest | ||
name: Pull Request Notification | ||
steps: | ||
- run: | | ||
echo "{\"text\":\"Vultr-CLI : PR https://github.com/vultr/vultr-cli/pull/${{ github.event.number }} \"}" > mattermost.json | ||
- uses: mattermost/action-mattermost-notify@master | ||
env: | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | ||
MATTERMOST_USERNAME: ${{ secrets.MATTERMOST_USERNAME}} | ||
MATTERMOST_ICON: ${{ secrets.MATTERMOST_ICON }} |
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,95 @@ | ||
name: "Automatic Releaser" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
check-commit: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
msg_check: ${{ steps.check-msg.outputs.match }} | ||
steps: | ||
- name: Check Message | ||
id: check-msg | ||
run: | | ||
pattern="^Release v[0-9]+.[0-9]+.[0-9]+ #(minor|major|patch)$" | ||
if [[ "${{ github.event.head_commit.message }}" =~ ${pattern} ]]; then | ||
echo ::set-output name=match::true | ||
fi | ||
create-tag: | ||
runs-on: ubuntu-latest | ||
if: needs.check-commit.outputs.msg_check == 'true' | ||
needs: check-commit | ||
outputs: | ||
new_tag: ${{ steps.tagger.outputs.new_tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Bump version and push tag | ||
id: tagger | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: "none" | ||
|
||
goreleaser: | ||
runs-on: ubuntu-latest | ||
needs: create-tag | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.20" | ||
- | ||
name: Docker Login | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.VULTRBOT_TOKEN }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Clear | ||
if: always() | ||
run: | | ||
rm -f ${HOME}/.docker/config.json | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: ["goreleaser", "create-tag"] | ||
name: Release Notification | ||
steps: | ||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
- run: | | ||
echo "{\"text\":\"Vultr-CLI : Release https://github.com/${{ github.repository }}/releases/tag/${{ needs.create-tag.outputs.new_tag }} \"}" > mattermost.json | ||
- uses: mattermost/action-mattermost-notify@master | ||
env: | ||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | ||
MATTERMOST_USERNAME: ${{ secrets.MATTERMOST_USERNAME}} | ||
MATTERMOST_ICON: ${{ secrets.MATTERMOST_ICON }} |
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 |
---|---|---|
|
@@ -20,4 +20,5 @@ | |
.vscode/ | ||
.idea | ||
builds/ | ||
dist/ | ||
dist/ | ||
vendor/ |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.