v0.3.4 #143
This file contains 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: pre-release | |
on: | |
pull_request: | |
branches: | |
- "main" | |
types: [opened,labeled,synchronize] | |
env: | |
IMAGE_TAG: aquascope:latest | |
jobs: | |
test-authentication: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Ping remote | |
uses: ./.github/workflows/run-on-remote | |
with: | |
file: deploy/ping.sh | |
credentials: ${{ secrets.GOOGLE_CREDENTIALS }} | |
project-id: ${{ secrets.GOOGLE_PROJECT_ID }} | |
ssh-key: ${{ secrets.GOOGLE_SSH_PRIVATE_KEY }} | |
check-publishable-versions: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
runs-on: ubuntu-latest | |
env: | |
LISP: ccl-bin | |
steps: | |
- run: echo Skipping silently | |
# - uses: actions/checkout@v3 | |
# - uses: 40ants/setup-lisp@v2 | |
# with: | |
# asdf-system: cl-info | |
# - name: Get Previous tag | |
# id: previoustag | |
# uses: WyriHaximus/github-action-get-previous-tag@v1 | |
# env: | |
# GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
# - name: Validate Version | |
# run: | | |
# cd scripts | |
# ros versioning.ros check ${{ steps.previoustag.outputs.tag }} | |
build-backend: | |
needs: [check-publishable-versions,test-authentication] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build and save docker image | |
run: | | |
docker build --tag "${IMAGE_TAG}" . | |
docker save --output image.tar "${IMAGE_TAG}" | |
- name: Build Aquascope serve | |
run: cargo build -p aquascope_serve --release | |
- name: Zip artifacts | |
run : zip -j artifacts.zip ./image.tar ./target/release/aquascope_serve | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
version: '>= 412.0.0' | |
- name: Upload artifacts | |
run: gcloud compute scp artifacts.zip gh-actions@aquascope:~/ --zone us-central1-c --tunnel-through-iap | |
update-frontend: | |
needs: build-backend | |
runs-on: ubuntu-latest | |
env: | |
AQUASCOPE_SERVER: "https://aquascope.willcrichton.net" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Quick Setup | |
uses: ./.github/workflows/quick-setup | |
- name: Build docs | |
run: | | |
cargo doc --lib | |
mv ./target/doc ./frontend/packages/aquascope-standalone/dist/doc | |
- uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages | |
folder: ./frontend/packages/aquascope-standalone/dist | |
clean: true | |
clean-exclude: dev | |
update-server: | |
needs: update-frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restart server | |
uses: ./.github/workflows/run-on-remote | |
with: | |
file: deploy/update.sh | |
credentials: ${{ secrets.GOOGLE_CREDENTIALS }} | |
project-id: ${{ secrets.GOOGLE_PROJECT_ID }} | |
ssh-key: ${{ secrets.GOOGLE_SSH_PRIVATE_KEY }} | |
publish-crates: | |
needs: [update-frontend,update-server] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions-rs/[email protected] | |
with: | |
crate: cargo-workspaces | |
version: latest | |
use-tool-cache: true | |
- uses: actions/checkout@v3 | |
- name: Quick Setup | |
uses: ./.github/workflows/quick-setup | |
# Run cargo build to ensure crates/mdbook-aquascope/js is populated | |
- run: cargo build | |
# --allow-dirty is for JS files packaged w/ mdbook-aquascope | |
- run: cargo ws publish --from-git --allow-dirty --yes --token ${{ secrets.CRATES_IO_TOKEN }} |