Upload Nightly Artifact #247
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upload Nightly Artifact | |
| on: | |
| schedule: | |
| - cron: '30 4 * * 3' | |
| workflow_dispatch: | |
| jobs: | |
| distribute-x86_64-linux-gnu: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup toolchain and cache | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Setup Zig | |
| uses: goto-bus-stop/setup-zig@v2 | |
| with: | |
| version: '0.12.0' | |
| - name: build | |
| run: | | |
| cargo install cargo-zigbuild | |
| cargo zigbuild --release --bin moshell --target x86_64-unknown-linux-gnu.2.28 | |
| mkdir build-output | |
| zip -r build-output/lib.zip lib | |
| mv target/x86_64-unknown-linux-gnu/release/moshell build-output/moshell | |
| date +"%D" > build-output/nightly-version | |
| - name: upload artifact | |
| uses: burnett01/rsync-deployments@6.0.0 | |
| with: | |
| switches: -avzr --delete | |
| path: build-output/ | |
| remote_path: /srv/moshell/releases/nightly/x86_64-linux-gnu | |
| remote_host: moshell.dev | |
| remote_user: maxime | |
| remote_key: ${{ secrets.SSH_SERVER }} | |
| distribute-apple-darwin: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| target: | |
| - x86_64-apple-darwin | |
| - aarch64-apple-darwin | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup toolchain and cache | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| - name: Build | |
| run: | | |
| SDKROOT=$(xcrun -sdk macosx --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version) cargo build --release --target ${{ matrix.target }} | |
| mkdir build-output | |
| zip -r build-output/lib.zip lib | |
| mv target/${{ matrix.target }}/release/moshell build-output/moshell | |
| date +"%D" > build-output/nightly-version | |
| - name: Upload artifact | |
| run: | | |
| brew install rsync | |
| mkdir -m 700 -p ~/.ssh | |
| echo "$REMOTE_KEY" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| rsync -e 'ssh -o StrictHostKeyChecking=no' -avzr --delete build-output/ maxime@moshell.dev:/srv/moshell/releases/nightly/${{ matrix.target }} | |
| env: | |
| REMOTE_KEY: ${{ secrets.SSH_SERVER }} |