Skip to content

Commit

Permalink
[SM-1297] Rename sm-sdk-go to sdk-go (#817)
Browse files Browse the repository at this point in the history
## 🎟️ Tracking

[SM-1297](https://bitwarden.atlassian.net/browse/SM-1297)

## 📔 Objective

Renames `sm-sdk-go` to `sdk-go` across the SDK. This should include GH
workflows as well as any Rust / Go code.

## ⏰ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
  team

## 🦮 Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
  issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or
concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or
indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes


[SM-1297]:
https://bitwarden.atlassian.net/browse/SM-1297?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
  • Loading branch information
coltonhurst authored Jun 4, 2024
1 parent 01b4dc0 commit f1e6a33
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ jobs:
- name: Checkout SDK-Go repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: bitwarden/sm-sdk-go
path: sm-sdk-go
repository: bitwarden/sdk-go
path: sdk-go
ref: main
token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}

- name: Setup Git
working-directory: sm-sdk-go
working-directory: sdk-go
run: |
git config --local user.email "${{ env._BOT_EMAIL }}"
git config --local user.name "${{ env._BOT_NAME }}"
Expand Down Expand Up @@ -132,31 +132,31 @@ jobs:

- name: Update files
run: |
# Copy files to local sm-sdk-go repo path
cp --verbose -rf sdk/languages/go/. sm-sdk-go
# Copy files to local sdk-go repo path
cp --verbose -rf sdk/languages/go/. sdk-go
# Remove the old cinterface lib files
rm -rf sm-sdk-go/internal/cinterface/lib/*
mkdir -p sm-sdk-go/internal/cinterface/lib/{darwin-{x64,arm64},linux-{x64,arm64},windows-x64}
rm -rf sdk-go/internal/cinterface/lib/*
mkdir -p sdk-go/internal/cinterface/lib/{darwin-{x64,arm64},linux-{x64,arm64},windows-x64}
- name: Extract static libs to their respective directories
run: |
unzip 'libbitwarden_c_files-x86_64-apple-darwin.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/darwin-x64
unzip 'libbitwarden_c_files-aarch64-apple-darwin.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/darwin-arm64
unzip 'libbitwarden_c_files-x86_64-unknown-linux-musl.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/linux-x64
unzip 'libbitwarden_c_files-aarch64-unknown-linux-musl.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/linux-arm64
unzip 'libbitwarden_c_files-x86_64-pc-windows-gnu.zip' '*.a' -d sm-sdk-go/internal/cinterface/lib/windows-x64
unzip 'libbitwarden_c_files-x86_64-apple-darwin.zip' '*.a' -d sdk-go/internal/cinterface/lib/darwin-x64
unzip 'libbitwarden_c_files-aarch64-apple-darwin.zip' '*.a' -d sdk-go/internal/cinterface/lib/darwin-arm64
unzip 'libbitwarden_c_files-x86_64-unknown-linux-musl.zip' '*.a' -d sdk-go/internal/cinterface/lib/linux-x64
unzip 'libbitwarden_c_files-aarch64-unknown-linux-musl.zip' '*.a' -d sdk-go/internal/cinterface/lib/linux-arm64
unzip 'libbitwarden_c_files-x86_64-pc-windows-gnu.zip' '*.a' -d sdk-go/internal/cinterface/lib/windows-x64
- name: Download artifacts
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: generate_schemas.yml
path: sm-sdk-go
path: sdk-go
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: schemas.go

- name: Push changes
working-directory: sm-sdk-go
working-directory: sdk-go
run: |
git add .
git commit -m "Update Go SDK to ${{ github.sha }}"
Expand All @@ -173,7 +173,7 @@ jobs:
- name: Create release tag on SDK Go repo
if: ${{ inputs.release_type != 'Dry Run' }}
working-directory: sm-sdk-go
working-directory: sdk-go
run: |
# Check if tag exists, set output then exit 0 if true.
if git log v${{ env._PKG_VERSION }} >/dev/null 2>&1; then
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
body: "<insert release notes here>"
token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
draft: true
repo: sm-sdk-go
repo: sdk-go
owner: bitwarden
artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip,
libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip,
Expand Down
2 changes: 1 addition & 1 deletion languages/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Download the SDK files and place them in your Go project directory.
To initialize the client, you need to import the SDK and create a new `BitwardenClient` instance.

```go
import "github.com/bitwarden/sm-sdk-go"
import "github.com/bitwarden/sdk-go"

bitwardenClient, _ := sdk.NewBitwardenClient(&apiURL, &identityURL)
```
Expand Down
2 changes: 1 addition & 1 deletion languages/go/bitwarden_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sdk
import (
"encoding/json"

"github.com/bitwarden/sm-sdk-go/internal/cinterface"
"github.com/bitwarden/sdk-go/internal/cinterface"
)

type BitwardenClientInterface interface {
Expand Down
2 changes: 1 addition & 1 deletion languages/go/command_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package sdk
import (
"encoding/json"

"github.com/bitwarden/sm-sdk-go/internal/cinterface"
"github.com/bitwarden/sdk-go/internal/cinterface"
)

type CommandRunnerInterface interface {
Expand Down
2 changes: 1 addition & 1 deletion languages/go/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"os"

sdk "github.com/bitwarden/sm-sdk-go"
sdk "github.com/bitwarden/sdk-go"
"github.com/gofrs/uuid"
)

Expand Down
4 changes: 2 additions & 2 deletions languages/go/example/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module example

replace github.com/bitwarden/sm-sdk-go => ../
replace github.com/bitwarden/sdk-go => ../

go 1.20

require (
github.com/bitwarden/sm-sdk-go v0.0.0-00010101000000-000000000000
github.com/bitwarden/sdk-go v0.0.0-00010101000000-000000000000
github.com/gofrs/uuid v4.4.0+incompatible
)
2 changes: 1 addition & 1 deletion languages/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/bitwarden/sm-sdk-go
module github.com/bitwarden/sdk-go

go 1.18

0 comments on commit f1e6a33

Please sign in to comment.