Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEVOPS-1750] Fix go release #646

Merged
merged 25 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bd96e79
Change go module name
michalchecinski Mar 1, 2024
ae7ea7a
Add precompiled C packages
michalchecinski Mar 1, 2024
55154c0
Comment out sync to the external repo for dry run
michalchecinski Mar 1, 2024
6665bfa
Add linux arm64 target
michalchecinski Mar 1, 2024
de20e4d
Download schemas artifact
michalchecinski Mar 1, 2024
bd59d6d
Comment for testing
michalchecinski Mar 1, 2024
92f1c87
Merge remote-tracking branch 'origin/main' into DEVOPS-1750-fix-go-re…
michalchecinski Mar 1, 2024
2304096
Fix
michalchecinski Mar 1, 2024
cac8d70
Fix
michalchecinski Mar 1, 2024
942b8cf
Fix
michalchecinski Mar 1, 2024
1fb081f
Download linux arm64 release from current branch
michalchecinski Mar 1, 2024
64fe83f
Fix
michalchecinski Mar 1, 2024
0fffee8
Remove testing values
michalchecinski Mar 1, 2024
4b4b9cc
Replace repo name
michalchecinski Mar 1, 2024
3640a0f
Install gcc-aarch64-linux-gnu
michalchecinski Mar 4, 2024
b42cfe8
Comment out aarch64 linux build
michalchecinski Mar 4, 2024
5f368bc
Comment out linux arm64
michalchecinski Mar 5, 2024
0da0223
Uncomment aarch64 linux
michalchecinski Mar 8, 2024
4ba442d
COmment for not working
michalchecinski Mar 11, 2024
4ddcfb6
Release
michalchecinski Mar 11, 2024
16fe378
Remove linux arm64 build - we need arm runner for that
michalchecinski Mar 11, 2024
e1de919
Update .github/workflows/release-go.yml
michalchecinski Mar 11, 2024
9518e1c
Fix
michalchecinski Mar 11, 2024
63a4ece
Merge branch 'DEVOPS-1750-fix-go-release' of https://github.com/bitwa…
michalchecinski Mar 11, 2024
997221b
Remove ls
michalchecinski Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build-rust-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- main
- rc
- hotfix-rc
pull_request:

jobs:
build_rust:
Expand All @@ -25,6 +26,8 @@ jobs:
target: x86_64-pc-windows-msvc
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
# - os: ubuntu-22.04
# target: aarch64-unknown-linux-gnu
vgrassia marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout
Expand All @@ -38,6 +41,10 @@ jobs:
- name: Cache cargo registry
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3

- name: Install gcc-aarch64-linux-gnu
if: matrix.settings.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu

- name: Add build architecture
run: rustup target add ${{ matrix.settings.target }}

Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/release-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,75 @@ 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: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
artifacts: schemas.go

- name: Download x86_64-apple-darwin artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
path: temp/macos-x64
workflow_conclusion: success
branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
artifacts: libbitwarden_c_files-x86_64-apple-darwin

- name: Download aarch64-apple-darwin artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
artifacts: libbitwarden_c_files-aarch64-apple-darwin
path: temp/macos-arm64

- name: Download x86_64-unknown-linux-gnu artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: temp/linux-x64

# - name: Download arm64-unknown-linux-gnu artifact
# uses: bitwarden/gh-actions/download-artifacts@main
# with:
# workflow: build-rust-cross-platform.yml
# workflow_conclusion: success
# branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
# artifacts: libbitwarden_c_files-arm64-unknown-linux-gnu
# path: temp/linux-arm64
vgrassia marked this conversation as resolved.
Show resolved Hide resolved

- name: Download x86_64-pc-windows-msvc artifact
uses: bitwarden/gh-actions/download-artifacts@main
with:
workflow: build-rust-cross-platform.yml
workflow_conclusion: success
branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
michalchecinski marked this conversation as resolved.
Show resolved Hide resolved
artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc
path: temp/windows-x64

- name: Copy lib files
run: |
mkdir -p sdk/languages/go/bitwarden_sdk_secrets/lib/macos-arm64
mkdir -p sdk/languages/go/bitwarden_sdk_secrets/lib/linux-x64
mkdir -p sdk/languages/go/bitwarden_sdk_secrets/lib/macos-x64
mkdir -p sdk/languages/go/bitwarden_sdk_secrets/lib/windows-x64
# mkdir -p sdk/languages/go/bitwarden_sdk_secrets/lib/linux-arm64

platforms=("macos-arm64" "linux-x64" "macos-x64" "windows-x64") # "linux-arm64"
files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll")

for ((i=0; i<${#platforms[@]}; i++)); do
cp "temp/${platforms[$i]}/${files[$i]}" "sdk/languages/go/bitwarden_sdk_secrets/lib/${platforms[$i]}/${files[$i]}"
done

- name: Login to Azure - Prod Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
with:
Expand Down Expand Up @@ -89,6 +158,12 @@ jobs:
# Copy files to local sm-sdk-go repo path
cp --verbose -rf sdk/languages/go/. sm-sdk-go

- name: Replace repo name
working-directory: sm-sdk-go
run: |
find . -name '*' -exec \
gsed -i -e 's/github.com\/bitwarden\/sdk\/languages\/go/github.com\/bitwarden\/sm-sdk-go/g' {} \;

- name: Push changes
working-directory: sm-sdk-go
run: |
Expand Down
Loading