-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ps/PM-6262-feature-flag-encrypt
- Loading branch information
Showing
8 changed files
with
218 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
coverage: | ||
status: | ||
patch: | ||
informational: true | ||
|
||
ignore: | ||
- "crates/sdk-schemas" # Tool | ||
- "crates/uniffi-bindgen" # Tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build Go SDK | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- rc | ||
- hotfix-rc | ||
|
||
pull_request: | ||
|
||
env: | ||
GO111MODULE: on | ||
GO_VERSION: "^1.18" | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Setup Go environment | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: npm ci | ||
run: npm ci | ||
|
||
- name: Generate schemas | ||
run: npm run schemas | ||
|
||
- name: Build | ||
working-directory: languages/go | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
working-directory: languages/go | ||
run: go test -v ./... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
name: Release Go | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
description: "Release Options" | ||
required: true | ||
default: "Release" | ||
type: choice | ||
options: | ||
- Release | ||
- Dry Run | ||
|
||
env: | ||
GO111MODULE: on | ||
GO_VERSION: "^1.18" | ||
|
||
jobs: | ||
validate: | ||
name: Setup | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Branch check | ||
if: ${{ github.event.inputs.release_type != 'Dry Run' }} | ||
run: | | ||
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then | ||
echo "===================================" | ||
echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" | ||
echo "===================================" | ||
exit 1 | ||
fi | ||
- name: Get version | ||
id: version | ||
run: | | ||
VERSION=$(cat languages/go/.version | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
repo-sync: | ||
name: Push changed files to SDK Go repo | ||
runs-on: ubuntu-22.04 | ||
needs: validate | ||
env: | ||
_KEY_VAULT: "bitwarden-ci" | ||
_BOT_EMAIL: [email protected] | ||
_BOT_NAME: bitwarden-devops-bot | ||
_PKG_VERSION: ${{ needs.validate.outputs.version }} | ||
steps: | ||
- name: Checkout SDK repo | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
with: | ||
path: sdk | ||
|
||
- name: Checkout SDK-Go repo | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
with: | ||
repository: bitwarden/sm-sdk-go | ||
path: sm-sdk-go | ||
ref: main | ||
|
||
- name: Login to Azure - Prod Subscription | ||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 | ||
with: | ||
creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} | ||
|
||
- name: Retrieve secrets | ||
id: retrieve-secrets | ||
uses: bitwarden/gh-actions/get-keyvault-secrets@62d1bf7c3e31c458cc7236b1e69a475d235cd78f | ||
with: | ||
keyvault: ${{ env._KEY_VAULT }} | ||
secrets: "github-pat-bitwarden-devops-bot-repo-scope" | ||
|
||
- name: Setup Git | ||
working-directory: sm-sdk-go | ||
run: | | ||
git config --local user.email "${{ env._BOT_EMAIL }}" | ||
git config --local user.name "${{ env._BOT_NAME }}" | ||
- name: Update files | ||
run: | | ||
# Copy files to local sm-sdk-go repo path | ||
cp --verbose -rf sdk/languages/go sm-sdk-go | ||
- name: Push changes | ||
working-directory: sm-sdk-go | ||
run: | | ||
git add . | ||
git commit -m "Update Go SDK to ${{ github.sha }}" | ||
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then | ||
echo "===================================" | ||
echo "[!] Dry Run - Skipping push" | ||
echo "===================================" | ||
git ls-files -m | ||
exit 0 | ||
else | ||
git push origin main | ||
fi | ||
- name: Create release tag on SDK Go repo | ||
if: ${{ github.event.inputs.release_type != 'Dry Run' }} | ||
working-directory: sm-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 | ||
echo "===================================" | ||
echo "[!] Tag v${{ env._PKG_VERSION }} already exists" | ||
echo "===================================" | ||
exit 1 | ||
fi | ||
git tag v${{ env._PKG_VERSION }} | ||
git push origin v${{ env._PKG_VERSION }} | ||
github-release: | ||
name: GitHub Release | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- repo-sync | ||
- validate | ||
env: | ||
_PKG_VERSION: ${{ needs.validate.outputs.version }} | ||
steps: | ||
- name: Login to Azure - Prod Subscription | ||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 | ||
with: | ||
creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} | ||
|
||
- name: Retrieve secrets | ||
id: retrieve-secrets | ||
uses: bitwarden/gh-actions/get-keyvault-secrets@62d1bf7c3e31c458cc7236b1e69a475d235cd78f | ||
with: | ||
keyvault: ${{ env._KEY_VAULT }} | ||
secrets: "github-pat-bitwarden-devops-bot-repo-scope" | ||
|
||
- name: Create release | ||
if: ${{ github.event.inputs.release_type != 'Dry Run' }} | ||
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 | ||
with: | ||
tag: v${{ env._PKG_VERSION }} | ||
name: v${{ env._PKG_VERSION }} | ||
body: "<insert release notes here>" | ||
token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} | ||
draft: true | ||
repo: bitwarden/sm-sdk-go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters