Skip to content

New Version! v0.4.1 #10

New Version! v0.4.1

New Version! v0.4.1 #10

Workflow file for this run

name: Release
on:
release:
types: [created]
env:
CARGO_TERM_COLOR: always
jobs:
release:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
artifact_name: astra
asset_name: astra-linux-amd64
name: release ${{ matrix.os }}
runs-on: ubuntu-20.04
environment: production
env:
CARGO_INCREMENTAL: 0
cache-key: "cargo-cache"
steps:
- uses: actions/checkout@v4
- uses: rui314/setup-mold@v1
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ env.cache-key }}
- name: Clear cache
continue-on-error: true # Don't fail if the cache doesn't exist
env:
GH_TOKEN: ${{ github.token }} # required by gh
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete "${{ env.cache-key }}" --confirm
- name: Build Server
run: cargo build --release
- name: Upload server binary to release
uses: svenstaro/upload-release-action@v2
with:
file: ./target/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
- uses: actions/cache/save@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target/
key: ${{ env.cache-key }}
- uses: chrnorm/deployment-action@v2
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
environment-url: https://github.com/ArkForgeLabs/Astra
environment: production
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "success"
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v2
with:
token: "${{ github.token }}"
environment-url: ${{ steps.deployment.outputs.environment_url }}
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
state: "failure"