@@ -35,32 +35,119 @@ jobs:
3535 - name : Set up Cloud SDK
3636 uses : google-github-actions/setup-gcloud@v2
3737
38+ - name : Install Bitwarden CLI
39+ run : |
40+ BW_DOWNLOAD_URL=$(curl -s https://api.github.com/repos/bitwarden/cli/releases/latest | grep '"browser_download_url".*linux.*zip' | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
41+ curl -L "${BW_DOWNLOAD_URL}" -o bw.zip
42+ unzip -q bw.zip
43+ chmod +x bw
44+ sudo mv bw /usr/local/bin/
45+ rm bw.zip
46+ bw --version
47+
3848 - name : Run end-to-end tests
3949 env :
50+ CGO_LDFLAGS : -lm
4051 GCP_PROJECT_ID : ${{ secrets.GCP_PROJECT_ID }}
52+ SSTART_E2E_BITWARDEN_ORGANIZATION_ID : ${{ secrets.SSTART_E2E_BITWARDEN_ORGANIZATION_ID }}
53+ BITWARDEN_SM_ACCESS_TOKEN : ${{ secrets.BITWARDEN_SM_ACCESS_TOKEN }}
54+ BW_PASSWORD : ${{ secrets.BW_PASSWORD }}
55+ BW_CLIENTSECRET : ${{ secrets.BW_CLIENTSECRET }}
56+ BW_CLIENTID : ${{ secrets.BW_CLIENTID }}
4157 run : go test -v ./tests/end2end/...
4258
4359 release :
4460 name : Build and Release
4561 needs : test
62+ strategy :
63+ matrix :
64+ include :
65+ - build_id : sstart-linux-amd64
66+ runner : ubuntu-latest
67+ - build_id : sstart-linux-arm64
68+ runner : ubuntu-latest
69+ - build_id : sstart-darwin-amd64
70+ runner : macos-latest
71+ - build_id : sstart-darwin-arm64
72+ runner : macos-latest
73+ - build_id : sstart-windows-amd64
74+ runner : windows-latest
75+ runs-on : ${{ matrix.runner }}
76+ steps :
77+ - name : Checkout code
78+ uses : actions/checkout@v4
79+ with :
80+ fetch-depth : 0
81+
82+ - name : Set up Go
83+ uses : actions/setup-go@v5
84+ with :
85+ go-version-file : go.mod
86+
87+ - name : Install Linux ARM64 cross-compilation toolchain (Linux ARM64 only)
88+ if : matrix.build_id == 'sstart-linux-arm64'
89+ run : |
90+ sudo apt-get update
91+ sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
92+ echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
93+ echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
94+ echo "AR=aarch64-linux-gnu-ar" >> $GITHUB_ENV
95+ echo "AS=aarch64-linux-gnu-as" >> $GITHUB_ENV
96+
97+ - name : Run GoReleaser (build only)
98+ uses : goreleaser/goreleaser-action@v5
99+ with :
100+ distribution : goreleaser
101+ version : latest
102+ args : build --clean --id=${{ matrix.build_id }}
103+ env :
104+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105+
106+ - name : Upload build artifacts
107+ uses : actions/upload-artifact@v4
108+ with :
109+ name : dist-${{ matrix.build_id }}
110+ path : dist/*
111+ retention-days : 1
112+
113+ package :
114+ name : Package and Release
115+ needs : release
46116 runs-on : ubuntu-latest
117+ if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
47118 steps :
48119 - name : Checkout code
49120 uses : actions/checkout@v4
50121 with :
51122 fetch-depth : 0
52123
124+ - name : Download all build artifacts
125+ uses : actions/download-artifact@v4
126+ with :
127+ path : dist-artifacts
128+
53129 - name : Set up Go
54130 uses : actions/setup-go@v5
55131 with :
56132 go-version-file : go.mod
57133
58- - name : Run GoReleaser
134+ - name : Prepare dist directory for GoReleaser
135+ run : |
136+ mkdir -p dist
137+ # GoReleaser expects binaries in dist/ with specific naming
138+ # Copy binaries maintaining GoReleaser's expected structure
139+ for dir in dist-artifacts/*/; do
140+ if [ -d "$dir" ]; then
141+ cp -r "$dir"* dist/ 2>/dev/null || true
142+ fi
143+ done
144+
145+ - name : Run GoReleaser (package and release)
59146 uses : goreleaser/goreleaser-action@v5
60147 with :
61148 distribution : goreleaser
62149 version : latest
63- args : release --clean
150+ args : release --clean --skip-build --skip-validate
64151 env :
65152 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66153
0 commit comments