chore(deps): bump indicatif from 0.17.6 to 0.17.7 #616
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: Run Tests & Publishing | |
on: [push, pull_request] | |
permissions: | |
contents: write | |
jobs: | |
lint: | |
name: Lint Codebase | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: clippy | |
- name: Configure sccache | |
uses: futursolo/sccache-action@affix-token-on-demand | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Run Lints | |
run: cargo make clippy | |
rustfmt: | |
name: Check Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt | |
- name: Check Formatting | |
run: cargo +nightly fmt -- --unstable-features | |
check-templates: | |
name: Check Templates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
with: | |
path: stellation | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: clippy | |
- name: Configure sccache | |
uses: futursolo/sccache-action@affix-token-on-demand | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Cargo Generate | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-generate | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Set Stellation Target to 'ci' | |
run: | | |
echo 'variable::set("stellation_target", "ci");' >> stellation/templates/default/resolve-crates.rhai | |
- name: Generate Template | |
run: | | |
set -x | |
mkdir templates-generated/ | |
cd templates-generated | |
for x in $(ls ../stellation/templates); do | |
if [ -d ../stellation/templates/$x ]; | |
then | |
echo "Creating Template $x..." | |
cargo generate --path ../stellation/templates/$x \ | |
--name generated-$x | |
fi | |
done | |
- name: Run Lints | |
run: | | |
set -x | |
for x in $(ls); do | |
cd $x | |
cargo make clippy | |
cd .. | |
done | |
working-directory: templates-generated | |
publish: | |
name: Publish to crates.io | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
- rustfmt | |
- check-templates | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Configure sccache | |
uses: futursolo/sccache-action@affix-token-on-demand | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install cargo-make | |
uses: davidB/rust-cargo-make@v1 | |
- name: Set Git Information | |
run: | | |
git config --global user.name "Stellation Actions" | |
git config --global user.email "actions@stellation.dummy" | |
- name: Prepare dry-run Registry | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
cargo install cargo-http-registry | |
mkdir -p /tmp/dry-run-registry | |
nohup cargo-http-registry /tmp/dry-run-registry & | |
echo "CARGO_PUBLISH_EXTRA_ARGS=--registry=dry-run" >> $GITHUB_ENV | |
echo "[registries.dry-run]" >> ~/.cargo/config | |
echo 'index = "file:///tmp/dry-run-registry"' >> ~/.cargo/config | |
echo 'token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"' >> ~/.cargo/config | |
- name: Modify to publish to dry-run Registry | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
run: | | |
pip install tomlkit | |
python3 ci/switch-registry.py | |
git commit -a -m "chore: switch to dry-run registry" | |
- name: Prepare crates.io Registry | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo "CARGO_PUBLISH_EXTRA_ARGS=--token=${{ secrets.CRATES_IO_TOKEN }}" >> $GITHUB_ENV | |
# Run lints first so it will be faster to run publish checks. | |
- name: Run Lints | |
run: cargo make clippy | |
- name: Run cargo publish | |
run: | | |
CRATES=( | |
stellation-core | |
stellation-bridge | |
stellation-backend | |
stellation-backend-warp | |
stellation-backend-tower | |
stellation-backend-cli | |
stellation-frontend | |
stellation-stylist | |
stctl | |
stellation | |
) | |
for s in "${CRATES[@]}"; | |
do | |
cargo publish \ | |
${{ env.CARGO_PUBLISH_EXTRA_ARGS }} \ | |
--manifest-path crates/$s/Cargo.toml | |
done | |
env: | |
RUSTFLAGS: "--cfg releasing" | |
publish-templates: | |
name: Publish Templates | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | |
needs: | |
- lint | |
- rustfmt | |
- check-templates | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@v3 | |
- name: Read Stellation Version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
STELLATION_VER=$(echo '${{ github.ref_name }}' | sed 's/v*//') | |
echo "Current version: $STELLATION_VER" | |
echo "STELLATION_VER=$STELLATION_VER" >> $GITHUB_ENV | |
- name: Set Stellation Target to 'main' | |
if: github.ref == 'refs/heads/main' | |
run: | | |
echo 'variable::set("stellation_target", "main");' >> templates/default/resolve-crates.rhai | |
- name: Set Stellation Target to 'release' | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo 'variable::set("stellation_target", "release");' >> templates/default/resolve-crates.rhai | |
- name: Set Stellation Version | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo 'variable::set("stellation_release_ver", "${{ env.STELLATION_VER }}");' >> templates/default/resolve-crates.rhai | |
- name: Publish Main Templates | |
if: github.ref == 'refs/heads/main' | |
uses: s0/git-publish-subdir-action@v2.6.0 | |
env: | |
REPO: self | |
BRANCH: templates-main | |
FOLDER: templates | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "chore: sync template for {sha}" | |
- name: Publish Main Templates | |
if: github.ref == 'refs/heads/main' | |
uses: s0/git-publish-subdir-action@v2.6.0 | |
env: | |
REPO: git@github.com:futursolo/stellation-templates.git | |
BRANCH: stellation-main | |
FOLDER: templates | |
MESSAGE: "chore: sync template for {sha}" | |
SSH_PRIVATE_KEY: ${{ secrets.TEMPLATE_DEPLOY_PRIVATE_KEY }} | |
- name: Publish Release Templates | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: s0/git-publish-subdir-action@v2.6.0 | |
env: | |
REPO: self | |
BRANCH: templates | |
FOLDER: templates | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "chore: sync template for ${{ github.ref_name }}" | |
- name: Publish Release Templates | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: s0/git-publish-subdir-action@v2.6.0 | |
env: | |
REPO: git@github.com:futursolo/stellation-templates.git | |
BRANCH: main | |
FOLDER: templates | |
MESSAGE: "chore: sync template for ${{ github.ref_name }}" | |
SSH_PRIVATE_KEY: ${{ secrets.TEMPLATE_DEPLOY_PRIVATE_KEY }} |