Skip to content

Commit 3c82f0d

Browse files
authored
chore: Adds release workflow and updates module name (#5)
1 parent dc4ff9e commit 3c82f0d

File tree

8 files changed

+164
-16
lines changed

8 files changed

+164
-16
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ blank_issues_enabled: false
22
contact_links:
33
- name: MongoDB Atlas App Services Support
44
url: https://support.mongodb.com/
5-
about: Support is provided under MongoDB support plans. Please submit support questions within the Realm UI.
5+
about: Support is provided under MongoDB support plans. Please submit support questions within the App Services UI.
66
- name: MongoDB MongoDB Atlas App Services
77
url: https://www.mongodb.com/docs/atlas/app-services/
88
about: Learn more about MongoDB MongoDB Atlas App Services

.github/pull_request_template.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
<!--
2-
Thanks for contributing to MongoDB Ops Manager Go Client!
3-
4-
Before you submit your pull request, please be sure that you've reviewed our contributing guidelines: https://github.com/mongodb/go-client-mongodb-ops-manager/blob/master/CONTRIBUTING.md
2+
Thanks for contributing to Atlas App Services Go client!
53
64
Please fill out the information below to help speed the review along, and hopefully
75
the merge of your pull request!
86
-->
97

108
## Proposed changes
119

12-
<!--
10+
<!-- s
1311
Describe the big picture of your changes here and communicate why we should accept this pull request.
1412
If it fixes a bug or resolves a feature request, be sure to link to that issue.
1513
-->
1614

1715
_Jira ticket:_
1816

17+
## Type of change:
18+
19+
- [ ] Bug fix (non-breaking change which fixes an issue).
20+
- [ ] New feature (non-breaking change which adds functionality).
21+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
22+
- [ ] This change requires a documentation update
23+
- [ ] Documentation fix/enhancement
24+
1925
<!--
20-
What MongoDB Ops Manager Go Client issue does this PR address? (for example, #1234), remove this section if none
26+
What Atlas App Services Go client issue does this PR address? (for example, #1234), remove this section if none
2127
-->
2228

2329
Closes #[issue number]
@@ -29,10 +35,10 @@ Put an `x` in the boxes that apply. You can also fill these out after creating t
2935
don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
3036
-->
3137

32-
- [] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
33-
- [] I have added tests that prove my fix is effective or that my feature works
34-
- [] I have added any necessary documentation (if appropriate)
35-
- [] I have run `make fmt` and formatted my code
38+
- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
39+
- [ ] I have added tests that prove my fix is effective or that my feature works
40+
- [ ] I have added any necessary documentation (if appropriate)
41+
- [ ] I have run `make fmt` and formatted my code
3642

3743
## Further comments
3844

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 'New Release'
2+
run-name: 'Release ${{ inputs.version_number }} (use existing tag: ${{ inputs.use_existing_tag}})'
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
version_number:
8+
description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)'
9+
required: true
10+
use_existing_tag:
11+
description: 'Set value to `true` to use an existing tag for the release process, default is `false`'
12+
default: 'false'
13+
14+
jobs:
15+
16+
release-config:
17+
runs-on: ubuntu-latest
18+
permissions: {}
19+
outputs:
20+
creates_new_tag: ${{ steps.evaluate_inputs.outputs.creates_new_tag }}
21+
steps:
22+
- id: evaluate_inputs
23+
run: |
24+
{
25+
echo "creates_new_tag=$(if [ '${{ inputs.use_existing_tag }}' = 'true' ]; then echo 'false'; else echo 'true'; fi)"
26+
} >> "$GITHUB_OUTPUT"
27+
28+
validate-inputs:
29+
runs-on: ubuntu-latest
30+
permissions: {}
31+
steps:
32+
- name: Validation of version format
33+
run: |
34+
echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$'
35+
- name: Checkout
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
37+
with:
38+
ref: ${{ inputs.use_existing_tag == 'true' && inputs.version_number || 'main' }}
39+
40+
create-tag:
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: write
44+
needs: [ release-config, validate-inputs ]
45+
if: >-
46+
!cancelled()
47+
&& !contains(needs.*.result, 'failure')
48+
&& needs.release-config.outputs.creates_new_tag == 'true'
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
52+
with:
53+
ref: 'main'
54+
- name: Get the latest commit SHA
55+
id: get-sha
56+
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
57+
- name: Create release tag
58+
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72
59+
with:
60+
tag: ${{ inputs.version_number }}
61+
commit_sha: ${{ steps.get-sha.outputs.sha }}
62+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
63+
gpg_passphrase: ${{ secrets.PASSPHRASE }}
64+
65+
release:
66+
runs-on: ubuntu-latest
67+
permissions:
68+
contents: write
69+
needs: [ validate-inputs, create-tag ]
70+
if: >-
71+
!cancelled()
72+
&& !contains(needs.*.result, 'failure')
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
76+
with:
77+
ref: ${{ inputs.version_number }}
78+
- name: Set up Go
79+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34
80+
with:
81+
go-version-file: 'go.mod'
82+
- name: Import GPG key
83+
id: import_gpg
84+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5
85+
with:
86+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
87+
passphrase: ${{ secrets.PASSPHRASE }}
88+
- name: Run GoReleaser
89+
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3
90+
with:
91+
version: '~> v2'
92+
args: release --clean
93+
env:
94+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
builds:
12+
- skip: true
13+
changelog:
14+
sort: asc
15+
use: github
16+
filters:
17+
exclude:
18+
- Merge pull request
19+
- Merge remote-tracking branch
20+
- Merge branch
21+
- go mod tidy
22+
groups:
23+
- title: "New Features"
24+
regexp: "^.*feat[(\\w)]*:+.*$"
25+
order: 0
26+
- title: "Bug fixes"
27+
regexp: "^.*fix[(\\w)]*:+.*$"
28+
order: 10
29+
- title: Other
30+
order: 999
31+
32+
checksum:
33+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
34+
algorithm: sha256
35+
36+
signs:
37+
- artifacts: checksum
38+
args:
39+
- "--batch"
40+
- "--local-user"
41+
- "{{ .Env.GPG_FINGERPRINT }}"
42+
- "--output"
43+
- "${signature}"
44+
- "--detach-sign"
45+
- "${artifact}"
46+
47+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Go HTTP client for the [MongoDB Atlas App Services Admin API](https://www.mong
66
## Usage
77

88
```go
9-
import "go.mongodb.org/atlas-appservices/appservices"
9+
import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices"
1010
```
1111

1212
Construct a new App Services client, then use the various services on the client to

appservices/appservices.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package appservices // import "go.mongodb.org/realm/realm"
15+
package appservices // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices"
1616

1717
import (
1818
"bytes"
@@ -27,9 +27,9 @@ import (
2727
"reflect"
2828
"strings"
2929

30-
"github.com/google/go-querystring/query"
31-
3230
"go.mongodb.org/atlas/mongodbatlas"
31+
32+
"github.com/google/go-querystring/query"
3333
)
3434

3535
const (

auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package auth // import "go.mongodb.org/realm/auth"
15+
package auth // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/auth"
1616

1717
import (
1818
"bytes"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module go.mongodb.org/atlas-appservices
1+
module github.com/mongodb-labs/go-client-mongodb-atlas-app-services
22

33
go 1.23
44

0 commit comments

Comments
 (0)