Skip to content

Commit abb4d09

Browse files
committed
#patch: update ci
1 parent c091fcc commit abb4d09

File tree

8 files changed

+96
-76
lines changed

8 files changed

+96
-76
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11

22
name: release
33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
workflow_run:
5+
workflows: ["Bump Git Version"]
6+
branches: [main]
7+
types:
8+
- completed
79
jobs:
810
goreleaser:
911
runs-on: ubuntu-latest
1012
steps:
11-
-
12-
name: Checkout
13+
- name: Checkout
1314
uses: actions/checkout@v2
14-
-
15-
name: Unshallow
15+
- name: Unshallow
1616
run: git fetch --prune --unshallow
17-
-
18-
name: Set up Go
17+
- name: Set up Go
1918
uses: actions/setup-go@v2
2019
with:
2120
go-version: 1.15
22-
-
23-
name: Import GPG key
21+
- name: Import GPG key
2422
id: import_gpg
2523
uses: paultyng/ghaction-import-gpg@v2.1.0
2624
env:
2725
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
2826
PASSPHRASE: ${{ secrets.PASSPHRASE }}
29-
-
30-
name: Run GoReleaser
27+
- name: Run GoReleaser
3128
uses: goreleaser/goreleaser-action@v2
3229
with:
3330
version: latest
3431
args: release --rm-dist
3532
env:
3633
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tag.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Bump Git Version
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
semver:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
tag: ${{ steps.tagging.outputs.new_tag }}
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: '0'
15+
- name: Bump version and push tag
16+
uses: anothrNick/github-tag-action@1.26.0
17+
id: tagging
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
WITH_V: true
21+
RELEASE_BRANCHES: main

.github/workflows/test.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1+
name: Test
12
on: [
23
push,
34
pull_request
45
]
5-
name: Test
66
jobs:
77
test:
8-
strategy:
9-
matrix:
10-
go-version: [
11-
1.15.x
12-
]
13-
os: [
14-
ubuntu-latest,
15-
]
16-
runs-on: ${{ matrix.os }}
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Install Go
11+
uses: actions/setup-go@v2
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Test
15+
env:
16+
TF_ACC: 1
17+
run: go test -coverprofile=coverage.txt ./...
18+
- name: Codecov
19+
uses: codecov/codecov-action@v1
20+
with:
21+
file: ./coverage.txt
22+
golangci-lint:
23+
runs-on: ubuntu-latest
1724
steps:
18-
- name: Install Go
19-
uses: actions/setup-go@v2
20-
with:
21-
go-version: ${{ matrix.go-version }}
22-
- name: Checkout code
23-
uses: actions/checkout@v2
24-
- name: Test
25-
env:
26-
TF_ACC: 1
27-
run: go test ./...
25+
- uses: actions/checkout@v2
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v2
28+
with:
29+
version: v1.32

.goreleaser.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# behavior.
33
before:
44
hooks:
5-
# this is just an example and not a requirement for provider building/publishing
65
- go mod tidy
76
builds:
87
- env:
@@ -38,15 +37,13 @@ checksum:
3837
signs:
3938
- artifacts: checksum
4039
args:
41-
# if you are using this is a GitHub action or some other automated pipeline, you
42-
# need to pass the batch flag to indicate its not interactive.
4340
- "--batch"
4441
- "--local-user"
45-
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
42+
- "{{ .Env.GPG_FINGERPRINT }}"
4643
- "--output"
4744
- "${signature}"
4845
- "--detach-sign"
4946
- "${artifact}"
50-
release:
51-
# If you want to manually examine the release before its live, uncomment this line:
52-
# draft: true
47+
changelog:
48+
skip: false
49+
sort: asc

examples/main.tf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
mcbroken = {
4-
source = "local/provider/mcbroken"
4+
source = "local/provider/mcbroken"
55
}
66
}
77
}
@@ -13,32 +13,32 @@ data "mcbroken_cities" "all" {}
1313

1414
// Data resource to get current outage percentage of a specific city
1515
data "mcbroken_city" "Dallas" {
16-
city = "Dallas"
16+
city = "Dallas"
1717
}
1818

1919
// If specified city isn't found, returns -1
2020
data "mcbroken_city" "not_found" {
21-
city = "not_found"
21+
city = "not_found"
2222
}
2323

2424
// Get national average of broken ice cream machines
2525
output "global_broken_average" {
26-
value = data.mcbroken_cities.all.broken
26+
value = data.mcbroken_cities.all.broken
2727
}
2828

2929
// Get list of all cities and their outage percentage
3030
output "all_available_cities" {
31-
value = data.mcbroken_cities.all.cities
31+
value = data.mcbroken_cities.all.cities
3232
}
3333

3434
// Get outage percentage of a specific city
3535
output "user_specified_city" {
36-
value = data.mcbroken_city.Dallas.broken
36+
value = data.mcbroken_city.Dallas.broken
3737
}
3838

3939
// When user specified city isn't found, return -1
4040
output "user_specified_city_not_found" {
41-
value = data.mcbroken_city.not_found.broken
41+
value = data.mcbroken_city.not_found.broken
4242
}
4343

4444
# Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
@@ -105,4 +105,4 @@ output "user_specified_city_not_found" {
105105
# ]
106106
# global_broken_average = 7.45
107107
# user_specified_city = 8.11
108-
# user_specified_city_not_found = -1
108+
# user_specified_city_not_found = -1

0 commit comments

Comments
 (0)