diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 93f2946..334d7a6 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: false contact_links: - name: MongoDB Atlas App Services Support url: https://support.mongodb.com/ - about: Support is provided under MongoDB support plans. Please submit support questions within the Realm UI. + about: Support is provided under MongoDB support plans. Please submit support questions within the App Services UI. - name: MongoDB MongoDB Atlas App Services url: https://www.mongodb.com/docs/atlas/app-services/ about: Learn more about MongoDB MongoDB Atlas App Services diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 761dfa0..cfb2289 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,7 +1,5 @@ _Jira ticket:_ +## Type of change: + +- [ ] Bug fix (non-breaking change which fixes an issue). +- [ ] New feature (non-breaking change which adds functionality). +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected). +- [ ] This change requires a documentation update +- [ ] Documentation fix/enhancement + Closes #[issue number] @@ -29,10 +35,10 @@ Put an `x` in the boxes that apply. You can also fill these out after creating t 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. --> -- [] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) -- [] I have added tests that prove my fix is effective or that my feature works -- [] I have added any necessary documentation (if appropriate) -- [] I have run `make fmt` and formatted my code +- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added any necessary documentation (if appropriate) +- [ ] I have run `make fmt` and formatted my code ## Further comments diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..06aeaa4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: 'New Release' +run-name: 'Release ${{ inputs.version_number }} (use existing tag: ${{ inputs.use_existing_tag}})' + +on: + workflow_dispatch: + inputs: + version_number: + description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)' + required: true + use_existing_tag: + description: 'Set value to `true` to use an existing tag for the release process, default is `false`' + default: 'false' + +jobs: + + release-config: + runs-on: ubuntu-latest + permissions: {} + outputs: + creates_new_tag: ${{ steps.evaluate_inputs.outputs.creates_new_tag }} + steps: + - id: evaluate_inputs + run: | + { + echo "creates_new_tag=$(if [ '${{ inputs.use_existing_tag }}' = 'true' ]; then echo 'false'; else echo 'true'; fi)" + } >> "$GITHUB_OUTPUT" + + validate-inputs: + runs-on: ubuntu-latest + permissions: {} + steps: + - name: Validation of version format + run: | + echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$' + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + ref: ${{ inputs.use_existing_tag == 'true' && inputs.version_number || 'main' }} + + create-tag: + runs-on: ubuntu-latest + permissions: + contents: write + needs: [ release-config, validate-inputs ] + if: >- + !cancelled() + && !contains(needs.*.result, 'failure') + && needs.release-config.outputs.creates_new_tag == 'true' + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + ref: 'main' + - name: Get the latest commit SHA + id: get-sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Create release tag + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: ${{ inputs.version_number }} + commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} + + release: + runs-on: ubuntu-latest + permissions: + contents: write + needs: [ validate-inputs, create-tag ] + if: >- + !cancelled() + && !contains(needs.*.result, 'failure') + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + ref: ${{ inputs.version_number }} + - name: Set up Go + uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 + with: + go-version-file: 'go.mod' + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 + with: + version: '~> v2' + args: release --clean + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..440199d --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,47 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com + +# The lines below are called `modelines`. See `:help modeline` +# Feel free to remove those if you don't want/need to use them. +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +builds: + - skip: true +changelog: + sort: asc + use: github + filters: + exclude: + - Merge pull request + - Merge remote-tracking branch + - Merge branch + - go mod tidy + groups: + - title: "New Features" + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: "Bug fixes" + regexp: "^.*fix[(\\w)]*:+.*$" + order: 10 + - title: Other + order: 999 + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" + algorithm: sha256 + +signs: + - artifacts: checksum + args: + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" + + diff --git a/README.md b/README.md index 7f42760..14f36fc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A Go HTTP client for the [MongoDB Atlas App Services Admin API](https://www.mong ## Usage ```go -import "go.mongodb.org/atlas-appservices/appservices" +import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices" ``` Construct a new App Services client, then use the various services on the client to diff --git a/appservices/appservices.go b/appservices/appservices.go index 87ccf88..6cc05d0 100644 --- a/appservices/appservices.go +++ b/appservices/appservices.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package appservices // import "go.mongodb.org/realm/realm" +package appservices // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/appservices" import ( "bytes" @@ -27,9 +27,9 @@ import ( "reflect" "strings" - "github.com/google/go-querystring/query" - "go.mongodb.org/atlas/mongodbatlas" + + "github.com/google/go-querystring/query" ) const ( diff --git a/auth/auth.go b/auth/auth.go index 40eebba..85426dd 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package auth // import "go.mongodb.org/realm/auth" +package auth // import "github.com/mongodb-labs/go-client-mongodb-atlas-app-services/auth" import ( "bytes" diff --git a/go.mod b/go.mod index ebcf338..7cb5afa 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go.mongodb.org/atlas-appservices +module github.com/mongodb-labs/go-client-mongodb-atlas-app-services go 1.23