-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix CI on master #2193
Fix CI on master #2193
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this! This looks great. A few small comments and then I think we're good to go.
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { name: x86_64 Linux, target: x86_64-unknown-linux-gnu, runner: bare-metal } | ||
- { name: aarch64 Linux, target: aarch64-unknown-linux-gnu, runner: arm-runner } | ||
- { name: aarch64 macOS, target: aarch64-apple-darwin, runner: macos-latest } | ||
- { name: x86_64 macOS, target: x86_64-apple-darwin, runner: macos-latest } | ||
- { name: x86_64 Windows, target: x86_64-pc-windows-msvc, runner: windows-latest } | ||
|
||
name: Build CLI for ${{ matrix.name }} | ||
runs-on: ${{ matrix.runner }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Show arch | ||
run: uname -a | ||
|
||
- name: Install Rust | ||
uses: dsherret/rust-toolchain-file@v1 | ||
|
||
- name: Install rust target | ||
run: rustup target add ${{ matrix.target }} | ||
|
||
- name: Compile | ||
run: | | ||
cargo build --release --target ${{ matrix.target }} -p spacetimedb-cli -p spacetimedb-standalone -p spacetimedb-update | ||
|
||
- name: Package (unix) | ||
if: ${{ runner.os != 'Windows' }} | ||
run: | | ||
mkdir build | ||
cd target/${{matrix.target}}/release | ||
tar -czf ../../../build/spacetime-${{matrix.target}}.tar.gz spacetimedb-{cli,standalone,update} | ||
|
||
- name: Package (windows) | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
mkdir build | ||
cd target/${{matrix.target}}/release | ||
7z a ../../../build/spacetime-${{matrix.target}}.zip spacetimedb-cli.exe spacetimedb-standalone.exe spacetimedb-update.exe | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Upload to DO Spaces | ||
uses: shallwefootball/s3-upload-action@master | ||
with: | ||
aws_key_id: ${{ secrets.AWS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | ||
aws_bucket: ${{ vars.AWS_BUCKET }} | ||
source_dir: build | ||
endpoint: https://nyc3.digitaloceanspaces.com | ||
destination_dir: ${{ steps.extract_branch.outputs.branch }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
run: uname -a | ||
|
||
- name: Install Rust | ||
uses: dsherret/rust-toolchain-file@v1 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
id: extract_branch | ||
|
||
- name: Upload to DO Spaces | ||
uses: shallwefootball/s3-upload-action@master |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blocking concerns left for me!
I think we should test the artifacts on MacOS + Windows to make sure they still work, but since they're currently broken, this PR definitely can't make things worse.
Windows link: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-x86_64-pc-windows-msvc.zip
Apple amd64: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-x86_64-apple-darwin.tar.gz
Apple arm64: https://spacetimedb-client-binaries.nyc3.digitaloceanspaces.com/noa/fix-master-ci/spacetime-aarch64-apple-darwin.tar.gz
(The Linux one seems to work for me, I un-tar
d and ran a trivial command on each of the binaries).
Description of Changes
Follow up to #2011, fixes #2159. I merged the different packaging jobs into a matrix, since it seems like they were all copy/pasted anyway and it makes it easier to make sure that the packaging process is consistent. I also tweaked the names of the artifacts, as I was talking about in #2126 (cc @clockworklabs/devops); they're now
spacetime-$LLVM_TARGET_TRIPLE.$EXE_OR_TARGZ
. I didn't maintain thecp --sparse=never
thing from #544, since it seems like the tar crate now supports sparse archives.Expected complexity level and risk
2
Testing
noa/fix-master-ci
for a tag name, but that obviously won't be an issue on master.