Skip to content

Commit

Permalink
[DEVOPS-1750] Change structure of sm-sdk-go repo (#677)
Browse files Browse the repository at this point in the history
## Type of change

<!-- (mark with an `X`) -->

```
- [ ] Bug fix
- [ ] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [x] Build/deploy pipeline (DevOps)
- [ ] Other
```

## Objective

<!--Describe what the purpose of this PR is. For example: what bug
you're fixing or what new feature you're adding-->

## Code changes

<!--Explain the changes you've made to each file or major component.
This should help the reviewer understand your changes-->
<!--Also refer to any related changes or PRs in other repositories-->

- **.github/workflows/release-go.yml:** Move `schemas.go` artifact to
the `sm-sdk-go` repo root and repack zip artifacts to include only
needed (`libbitwarden_c.*`) files.

## Before you submit

- Please add **unit tests** where it makes sense to do so
  • Loading branch information
michalchecinski committed Mar 25, 2024
1 parent 67e743f commit cb2e1f3
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/release-go.yml
Expand Up @@ -58,15 +58,6 @@ jobs:
with:
path: sdk

- name: Download artifacts
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: generate_schemas.yml
path: sdk/languages/go/bitwarden_sdk_secrets/lib
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: schemas.go

- name: Login to Azure - Prod Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
with:
Expand Down Expand Up @@ -98,6 +89,15 @@ jobs:
# Copy files to local sm-sdk-go repo path
cp --verbose -rf sdk/languages/go/. sm-sdk-go
- name: Download artifacts
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: generate_schemas.yml
path: sm-sdk-go
workflow_conclusion: success
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
artifacts: schemas.go

- name: Replace repo name
working-directory: sm-sdk-go
run: |
Expand Down Expand Up @@ -194,10 +194,16 @@ jobs:

- name: Rename build artifacts
run: |
mv libbitwarden_c_files-x86_64-apple-darwin.zip libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION.zip
mv libbitwarden_c_files-aarch64-apple-darwin.zip libbitwarden_c_files-aarch64-apple-darwin-$_PKG_VERSION.zip
mv libbitwarden_c_files-x86_64-unknown-linux-gnu.zip libbitwarden_c_files-x86_64-unknown-linux-gnu-$_PKG_VERSION.zip
mv libbitwarden_c_files-x86_64-pc-windows-msvc.zip libbitwarden_c_files-x86_64-pc-windows-msvc-$_PKG_VERSION.zip
artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc") # aarch64-unknown-linux-gnu)
for value in "${artifacts[@]}"
do
unzip libbitwarden_c_files-$value.zip -d libbitwarden_c_files-$value
cd libbitwarden_c_files-$value
zip -Rj ../libbitwarden_c_files-$value-$_PKG_VERSION.zip 'libbitwarden_c.*'
cd ..
done
ls ./libbitwarden_c_files-x86_64-apple-darwin-$_PKG_VERSION -lRa
- name: Create release
if: ${{ inputs.release_type != 'Dry Run' }}
Expand Down

0 comments on commit cb2e1f3

Please sign in to comment.