Skip to content

Commit 22c1a34

Browse files
committed
feat: Implemented plugin for working with Bitbucket
0 parents  commit 22c1a34

File tree

15 files changed

+935
-0
lines changed

15 files changed

+935
-0
lines changed

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
charset = utf-8
8+
9+
[*.json]
10+
indent_style = space
11+
indent_size = 4
12+
13+
[Makefile,*.Makefile]
14+
indent_style = tab
15+
indent_size = 4
16+
17+
[*.go]
18+
indent_style = tab
19+
indent_size = 4
20+
21+
[*.sh]
22+
indent_style = space
23+
indent_size = 4
24+
25+
[*.{yml,yaml}]
26+
indent_style = space
27+
indent_size = 2

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: gomod
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
9+
assignees:
10+
- durandj
11+
reviewers:
12+
- durandj
13+
14+
- package-ecosystem: github-actions
15+
directory: /
16+
schedule:
17+
interval: weekly
18+
19+
assignees:
20+
- durandj
21+
reviewers:
22+
- durandj

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: golangci-lint
16+
run: |
17+
make lint
18+
19+
build:
20+
runs-on: ${{ matrix.os }}
21+
needs: lint
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
os: [macos-latest, windows-latest, ubuntu-latest]
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.16
31+
- run: make test
32+
- run: make build
33+
34+
release:
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: actions/setup-go@v2
40+
with:
41+
go-version: 1.16
42+
- name: Get release dependencies
43+
run: |
44+
go get github.com/mitchellh/gox
45+
go get github.com/tcnksm/ghr
46+
- uses: go-semantic-release/action@v1
47+
id: semrel
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
ghr: true
51+
- run: |
52+
gox \
53+
-parallel 4 \
54+
-osarch="linux/amd64 darwin/amd64 linux/arm windows/amd64" \
55+
-ldflags="-extldflags '-static' -s -w -X github.com/durandj/semantic-release-condition-bitbucket/pkg/condition.CIVERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" \
56+
./cmd/condition-bitbucket/
57+
58+
cd bin/ && shasum -a 256 * > ./condition-bitbucket_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
59+
if: steps.semrel.outputs.version != ''
60+
env:
61+
CGO_ENABLED: 0
62+
- run: ghr $(cat .ghr) bin/
63+
if: steps.semrel.outputs.version != ''
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
### condition-bitbucket ###
2+
/.semrel
3+
/bin
4+
5+
6+
7+
### Go ###
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
25+
26+
### Linux ###
27+
*~
28+
29+
# temporary files which can be created if a process still has a handle open of a deleted file
30+
.fuse_hidden*
31+
32+
# KDE directory preferences
33+
.directory
34+
35+
# Linux trash folder which might appear on any partition or disk
36+
.Trash-*
37+
38+
# .nfs files are created when an open file is removed but is still being accessed
39+
.nfs*
40+
41+
42+
43+
### macOS ###
44+
# General
45+
.DS_Store
46+
.AppleDouble
47+
.LSOverride
48+
49+
# Icon must end with two \r
50+
Icon
51+
52+
53+
# Thumbnails
54+
._*
55+
56+
# Files that might appear in the root of a volume
57+
.DocumentRevisions-V100
58+
.fseventsd
59+
.Spotlight-V100
60+
.TemporaryItems
61+
.Trashes
62+
.VolumeIcon.icns
63+
.com.apple.timemachine.donotpresent
64+
65+
# Directories potentially created on remote AFP share
66+
.AppleDB
67+
.AppleDesktop
68+
Network Trash Folder
69+
Temporary Items
70+
.apdisk
71+
72+
73+
74+
### JetBrains ###
75+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
76+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
77+
78+
# User-specific stuff
79+
.idea/**/workspace.xml
80+
.idea/**/tasks.xml
81+
.idea/**/usage.statistics.xml
82+
.idea/**/dictionaries
83+
.idea/**/shelf
84+
85+
# Generated files
86+
.idea/**/contentModel.xml
87+
88+
# Sensitive or high-churn files
89+
.idea/**/dataSources/
90+
.idea/**/dataSources.ids
91+
.idea/**/dataSources.local.xml
92+
.idea/**/sqlDataSources.xml
93+
.idea/**/dynamic.xml
94+
.idea/**/uiDesigner.xml
95+
.idea/**/dbnavigator.xml
96+
97+
# Gradle
98+
.idea/**/gradle.xml
99+
.idea/**/libraries
100+
101+
# Gradle and Maven with auto-import
102+
# When using Gradle or Maven with auto-import, you should exclude module files,
103+
# since they will be recreated, and may cause churn. Uncomment if using
104+
# auto-import.
105+
# .idea/artifacts
106+
# .idea/compiler.xml
107+
# .idea/jarRepositories.xml
108+
# .idea/modules.xml
109+
# .idea/*.iml
110+
# .idea/modules
111+
# *.iml
112+
# *.ipr
113+
114+
# CMake
115+
cmake-build-*/
116+
117+
# Mongo Explorer plugin
118+
.idea/**/mongoSettings.xml
119+
120+
# File-based project format
121+
*.iws
122+
123+
# IntelliJ
124+
out/
125+
126+
# mpeltonen/sbt-idea plugin
127+
.idea_modules/
128+
129+
# JIRA plugin
130+
atlassian-ide-plugin.xml
131+
132+
# Cursive Clojure plugin
133+
.idea/replstate.xml
134+
135+
# Crashlytics plugin (for Android Studio and IntelliJ)
136+
com_crashlytics_export_strings.xml
137+
crashlytics.properties
138+
crashlytics-build.properties
139+
fabric.properties
140+
141+
# Editor-based Rest Client
142+
.idea/httpRequests
143+
144+
# Android studio 3.1+ serialized cache file
145+
.idea/caches/build_file_checksums.ser
146+
147+
148+
149+
### VisualStudioCode ###
150+
.vscode/*
151+
!.vscode/settings.json
152+
!.vscode/tasks.json
153+
!.vscode/launch.json
154+
!.vscode/extensions.json
155+
*.code-workspace
156+
157+
# Local History for Visual Studio Code
158+
.history/
159+
160+
### Vim ###
161+
162+
163+
# Swap
164+
[._]*.s[a-v][a-z]
165+
!*.svg # comment out if you don't need vector files
166+
[._]*.sw[a-p]
167+
[._]s[a-rt-v][a-z]
168+
[._]ss[a-gi-z]
169+
[._]sw[a-p]
170+
171+
# Session
172+
Session.vim
173+
Sessionx.vim
174+
175+
# Temporary
176+
.netrwhist
177+
*~
178+
# Auto-generated tag files
179+
tags
180+
# Persistent undo
181+
[._]*.un~

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.16.0

.golangci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
linters:
2+
enable:
3+
- bodyclose
4+
- errcheck
5+
- dupl
6+
- gocognit
7+
- goconst
8+
- gocritic
9+
- gocyclo
10+
- gofmt
11+
- goimports
12+
- golint
13+
- gosec
14+
- govet
15+
- lll
16+
- nakedret
17+
- prealloc
18+
- scopelint
19+
- staticcheck
20+
- unconvert
21+
- unparam
22+
- whitespace
23+
24+
issues:
25+
exclude-use-default: false

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"go.inferGopath": false,
3+
"go.lintTool": "golangci-lint",
4+
}

License.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2021 James Durand
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
REPO_ROOT = $(shell git rev-parse --show-toplevel)
2+
BIN_DIR = $(REPO_ROOT)/bin
3+
4+
$(BIN_DIR):
5+
mkdir -p $@
6+
7+
######################################################################
8+
9+
NAME = condition-bitbucket
10+
BIN = $(BIN_DIR)/$(NAME)
11+
12+
######################################################################
13+
14+
GOLANGCILINT_VERSION = v1.38.0
15+
GOLANGCILINT_NAME = golangci-lint
16+
GOLANGCILINT_PATH = $(REPO_ROOT)/bin
17+
GOLANGCILINT_URL = https://install.goreleaser.com/github.com/golangci/golangci-lint.sh
18+
GOLANGCILINT = $(REPO_ROOT)/bin/$(GOLANGCILINT_NAME)
19+
20+
$(GOLANGCILINT):
21+
cd $(REPO_ROOT); curl -sfL $(GOLANGCILINT_URL) | sh -s $(GOLANGCILINT_VERSION)
22+
23+
######################################################################
24+
25+
26+
27+
######################################################################
28+
29+
.PHONY: clean
30+
clean:
31+
rm -f $(BIN)
32+
33+
.PHONY: lint
34+
lint: $(GOLANGCILINT)
35+
$(GOLANGCILINT) run
36+
37+
.PHONY: test
38+
test:
39+
go test -v ./...
40+
41+
.PHONY: build
42+
build:
43+
go build -o $(BIN) $(REPO_ROOT)/cmd/condition-bitbucket

0 commit comments

Comments
 (0)