Skip to content

Commit

Permalink
Copy deploy workflow from a5e4a73
Browse files Browse the repository at this point in the history
  • Loading branch information
jolampi committed Nov 22, 2021
1 parent b98299d commit 94eec1d
Showing 1 changed file with 1 addition and 118 deletions.
119 changes: 1 addition & 118 deletions .github/workflows/upload-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
target:
[
x86_64-unknown-linux-gnu,
i686-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
armv7-unknown-linux-gnueabihf,
]
target: [x86_64-unknown-linux-gnu]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -58,114 +52,3 @@ jobs:
# build and deploy CLI
cargo build -p tmc-langs-cli --release --target ${{ matrix.target }}
gsutil cp target/${{ matrix.target }}/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-${{ matrix.target }}-$TAG
# build and deploy Node module
npm --prefix ./bindings/tmc-langs-node install
npm --prefix ./bindings/tmc-langs-node run build -- --release --target ${{ matrix.target }}
gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-${{ matrix.target }}-$TAG.node
windows:
runs-on: windows-latest
strategy:
matrix:
target: [i686-pc-windows-msvc, x86_64-pc-windows-msvc]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: GCloud
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Build
run: |
rustup target add ${{ matrix.target }}
$env:RUSTFLAGS="-C target-feature=+crt-static" # crt-static is set with RUSTFLAGS to statically link MSVCRT (VCRUNTIME140.dll)
cargo build -p tmc-langs-cli --release --target ${{ matrix.target }}
cd ./bindings/tmc-langs-node && npm install && npm run build -- --release --target ${{ matrix.target }}
- name: Deploy
run: |
$env:python_version=$(python -c 'import sys; print(\".\".join(map(str, sys.version_info[:3])))')
$env:CLOUDSDK_PYTHON="C:\hostedtoolcache\windows\Python\$env:python_version\x64\python"
gsutil cp target/${{ matrix.target }}/release/tmc-langs-cli.exe gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-${{ matrix.target }}-$Env:TAG.exe
gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-${{ matrix.target }}-$Env:TAG.node
macos:
runs-on: macos-10.15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: GCloud
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Cargo build
run: |
cargo build -p tmc-langs-cli --release
npm --prefix ./bindings/tmc-langs-node install
npm run --prefix ./bindings/tmc-langs-node build -- --release
- name: Sign
run: codesign --force -s - target/release/tmc-langs-cli
- name: Deploy
run: |
gsutil cp target/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-x86_64-apple-darwin-$TAG
gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-x86_64-apple-darwin-$TAG.node
macos-11:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: GCloud
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}

- name: Cargo build
run: |
cargo build -p tmc-langs-cli --release
npm --prefix ./bindings/tmc-langs-node install
npm run --prefix ./bindings/tmc-langs-node build -- --release
- name: Sign
run: codesign --force -s - target/release/tmc-langs-cli
- name: Deploy
run: |
gsutil cp target/release/tmc-langs-cli gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-cli-aarch64-apple-darwin-$TAG
gsutil cp bindings/tmc-langs-node/ts/functions.node gs://${{ secrets.GCP_BUCKET }}/tmc-langs-rust/tmc-langs-aarch64-apple-darwin-$TAG.node

0 comments on commit 94eec1d

Please sign in to comment.