Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 35 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
env:
TOKEN: ${{ secrets.RIDECELL_PUBLIC_REPO_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Setup gitconfig fot private go module
Expand All @@ -30,16 +30,16 @@ jobs:
env:
TOKEN: ${{ secrets.RIDECELL_PUBLIC_REPO_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v7
with:
go-version-file: go.mod

- name: Setup gitconfig for private go modules
run: |
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/Ridecell".insteadOf "https://github.com/Ridecell"

- name: build
run: |
make build_macos build_linux
Expand All @@ -52,3 +52,33 @@ jobs:
mv bin/ridectl.linux bin/ridectl && zip -jrm bin/ridectl_linux.zip bin/ridectl
go install github.com/tcnksm/ghr@latest
ghr -c ${{ github.sha }} ${{ github.ref_name }} bin/

build-linux-arm64:
name: Build Linux arm64
runs-on: ubuntu-24.04-arm
needs: lint
env:
TOKEN: ${{ secrets.RIDECELL_PUBLIC_REPO_TOKEN }}
steps:
- uses: actions/checkout@v7
- name: Setup go
uses: actions/setup-go@v7
with:
go-version-file: go.mod

- name: Setup gitconfig for private go modules
run: |
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/Ridecell".insteadOf "https://github.com/Ridecell"

- name: build
run: |
make build_linux_arm64

- name: Release
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv bin/ridectl.linux.arm64 bin/ridectl && zip -jrm bin/ridectl_linux_arm64.zip bin/ridectl
go install github.com/tcnksm/ghr@latest
ghr -c ${{ github.sha }} ${{ github.ref_name }} bin/
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ build_macos:
# Build command binary, for Linux
build_linux:
./build_ridectl.sh linux $(TSH_VERSION)

# Build command binary, for Linux arm64
build_linux_arm64:
./build_ridectl.sh linux_arm64 $(TSH_VERSION)
6 changes: 6 additions & 0 deletions build_ridectl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ then
tar -xf teleport-v$TSH_VERSION-linux-amd64-bin.tar.gz
cp teleport/tsh pkg/exec/bin/
GOOS=linux GOARCH=amd64 go build -o bin/ridectl.linux -ldflags "-X github.com/Ridecell/ridectl/pkg/exec.tshMD5=$(md5sum teleport/tsh | awk '{ print $1 }'| tr -d '\n') -X github.com/Ridecell/ridectl/pkg/cmd.version=$(git describe --tags)" -tags release github.com/Ridecell/ridectl/cmd/ridectl
elif [[ "$OS" == "linux_arm64" ]]
then
wget https://get.gravitational.com/teleport-v$TSH_VERSION-linux-arm64-bin.tar.gz
tar -xf teleport-v$TSH_VERSION-linux-arm64-bin.tar.gz
cp teleport/tsh pkg/exec/bin/
GOOS=linux GOARCH=arm64 go build -o bin/ridectl.linux.arm64 -ldflags "-X github.com/Ridecell/ridectl/pkg/exec.tshMD5=$(md5sum teleport/tsh | awk '{ print $1 }'| tr -d '\n') -X github.com/Ridecell/ridectl/pkg/cmd.version=$(git describe --tags)" -tags release github.com/Ridecell/ridectl/cmd/ridectl
else
echo "Invalid OS value: $OS, exiting."
exit 1
Expand Down