Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

πŸ”– Publish 0.13.4 #103

πŸ”– Publish 0.13.4

πŸ”– Publish 0.13.4 #103

Workflow file for this run

name: ✨ Publish
run-name: πŸ”– Publish ${{ github.ref_name }}
on:
release:
types: ["published"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: πŸ— Build
runs-on: ubuntu-latest
steps:
- name: ✨ Set up the toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: aarch64-unknown-linux-gnu
override: true
- name: πŸ“₯ Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: πŸ–Š Set crate version
run: |
echo 'version = "${{ github.ref_name }}"'
sed -i -e 's/version = "0.0.0"/version = "${{ github.ref_name }}"/g' Cargo.toml
sed -i -e 's/version = "0.0.0"/version = "${{ github.ref_name }}"/g' Cargo.lock
- name: πŸ“ Build Changelog
id: changelog
uses: Bullrich/generate-release-changelog@master
env:
REPO: ${{ github.repository }}
- name: πŸ“ Update release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changelog }}
- name: πŸ‘· Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target=aarch64-unknown-linux-gnu
- name: πŸ“€ Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target/aarch64-unknown-linux-gnu/release/blitz-tanks
asset_name: blitz-tanks.aarch64-unknown-linux-gnu
asset_content_type: application/octet-stream
- name: πŸ› Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: eigenein
SENTRY_PROJECT: blitz-tanks
with:
environment: production
version: ${{ github.ref_name }}
publish:
name: ✨ Publish
runs-on: ubuntu-latest
needs: build
steps:
- name: πŸ“₯ Download release asset
uses: dsaltares/fetch-gh-release-asset@master
with:
version: tags/${{ github.ref_name }}
file: blitz-tanks.aarch64-unknown-linux-gnu
target: blitz-tanks.aarch64-unknown-linux-gnu
- name: πŸ•Έ Set up Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TAILSCALE_CLIENT_ID }}
oauth-secret: ${{ secrets.TAILSCALE_CLIENT_SECRET }}
tags: tag:ci
- name: ♻️ Rsync
run: |
chmod +x blitz-tanks.aarch64-unknown-linux-gnu
rsync --rsh="ssh -o StrictHostKeyChecking=no" --compress --executability --stats --times --verbose blitz-tanks.aarch64-unknown-linux-gnu "pi@mars:/home/pi/bin/blitz-tanks"
- name: πŸ’ͺ Refit the model
run: ssh -o StrictHostKeyChecking=no pi@mars "BLITZ_TANKS_ENVFILE=.blitz-tanks/.env bin/blitz-tanks trainer fit"
- name: 🏁 Restart
run: ssh -o StrictHostKeyChecking=no pi@mars "sudo systemctl restart blitz-tanks; systemctl status --lines=0 blitz-tanks"