Skip to content

chore(docs): migrate image to LFS #3774

chore(docs): migrate image to LFS

chore(docs): migrate image to LFS #3774

Workflow file for this run

name: Build Trunk
on:
pull_request:
branches:
- master
paths-ignore:
- "docs/**"
types:
- opened
- synchronize
- reopened
- ready_for_review
- converted_to_draft
push:
branches:
- master
workflow_dispatch:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
permissions: { }
jobs:
build-linux:
name: Build Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }})
strategy: &runner_linux_strategy
matrix:
include:
- runner: ubicloud-standard-16-ubuntu-2204
arch: x86_64
vendor: unknown
sys: linux
abi: gnu
runs-on: ${{ matrix.runner }}
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
env:
TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }}
permissions:
contents: read
steps:
- name: Check out Acton repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Cache Cargo
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ runner.os }}-${{ runner.arch }}
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Install Rust
run: rustup toolchain install
- name: Installing additional Rust components
uses: taiki-e/install-action@184183c2401be73c3bf42c2e61268aa5855379c1 # v2.78.1
with:
tool: just@1.49.0,nextest@0.9.133
fallback: none
- name: Download TON objects archive
env:
GH_TOKEN: ${{ github.token }}
# language=Bash
run: |
ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz"
mkdir -p objs
gh release download release-objs \
--repo "${GITHUB_REPOSITORY}" \
--pattern "${ARCHIVE_NAME}" \
--dir "${RUNNER_TEMP}"
tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}"
- name: Install LLVM and Clang
timeout-minutes: 5
# language=Bash
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16 clang
rm llvm.sh
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Restore Bun cache
id: bun-cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: &linux-build-ui-bun-cache-path |
~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-build-ui-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-build-ui-
- name: Build acton binary
env:
ACTON_RELEASE_CHANNEL: trunk
CC: clang-16
CXX: clang++-16
# language=Bash
run: |
just build-ui
cargo build --release --locked --target "${TARGET_NAME}" --bin acton
- name: Add acton to PATH
run: echo "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release" >> "$GITHUB_PATH"
- name: Test acton binary
run: |
acton --help
- name: Run tests
run: |
just test
- name: Save Bun cache
if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: *linux-build-ui-bun-cache-path
key: ${{ steps.bun-cache.outputs.cache-primary-key }}
- name: Prepare trunk archive
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
run: |
cargo xtask dist archive --target "${TARGET_NAME}" --profile release
- name: Upload trunk archive artifact
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: artifacts-${{ env.TARGET_NAME }}
path: |
acton-${{ env.TARGET_NAME }}.tar.gz
acton-${{ env.TARGET_NAME }}.tar.gz.sha256
retention-days: 1
if-no-files-found: error
- name: Check Acton target binary
shell: bash
# language=Bash
run: |
python3 "${GITHUB_WORKSPACE}/.github/scripts/check-rust-target-binary.py" \
--binary "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release/acton" \
--target "${TARGET_NAME}"
lint:
name: Lint Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }})
strategy: *runner_linux_strategy
runs-on: ${{ matrix.runner }}
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
env:
TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}-${{ matrix.abi }}
permissions:
contents: read
steps:
- name: Check out Acton repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Cache Cargo
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ runner.os }}-${{ runner.arch }}
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Install Rust
run: rustup toolchain install
- name: Installing additional Rust components
uses: taiki-e/install-action@184183c2401be73c3bf42c2e61268aa5855379c1 # v2.78.1
with:
tool: just@1.49.0,cargo-shear@1.11.2,typos@1.46.1
fallback: none
- name: Download TON objects archive
env:
GH_TOKEN: ${{ github.token }}
# language=Bash
run: |
ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz"
mkdir -p objs
gh release download release-objs \
--repo "${GITHUB_REPOSITORY}" \
--pattern "${ARCHIVE_NAME}" \
--dir "${RUNNER_TEMP}"
tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}"
- name: Run formatter and linter
run: |
just check-ci
ui:
name: UI (${{ matrix.sys }}-${{ matrix.arch }})
strategy: *runner_linux_strategy
runs-on: ${{ matrix.runner }}
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
permissions:
contents: read
steps:
- name: Check out Acton repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Installing additional Rust components
uses: taiki-e/install-action@184183c2401be73c3bf42c2e61268aa5855379c1 # v2.78.1
with:
tool: just@1.49.0
fallback: none
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Restore Bun cache
id: bun-cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: &linux-lint-ui-bun-cache-path |
~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-lint-ui-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-lint-ui-
- name: Install UI dependencies
run: bun ci
- name: Run UI checks
run: |
just check-ui-ci
- name: Save Bun cache
if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: *linux-lint-ui-bun-cache-path
key: ${{ steps.bun-cache.outputs.cache-primary-key }}
build-macos:
name: Build Acton (${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }})
strategy: &runner_macos_strategy
matrix:
include:
- runner: macos-15
arch: aarch64
vendor: apple
sys: darwin
runs-on: ${{ matrix.runner }}
if: github.ref == 'refs/heads/master' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
env:
TARGET_NAME: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.sys }}
permissions:
contents: read
steps:
- name: Check out Acton repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Cache Cargo
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ runner.os }}-${{ runner.arch }}
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Install Rust
run: rustup toolchain install
- name: Installing additional Rust components
uses: taiki-e/install-action@184183c2401be73c3bf42c2e61268aa5855379c1 # v2.78.1
with:
tool: just@1.49.0,nextest@0.9.133
fallback: none
- name: Download TON objects archive
env:
GH_TOKEN: ${{ github.token }}
# language=Bash
run: |
ARCHIVE_NAME="ton-objs-${TARGET_NAME}.tar.gz"
mkdir -p objs
gh release download release-objs \
--repo "${GITHUB_REPOSITORY}" \
--pattern "${ARCHIVE_NAME}" \
--dir "${RUNNER_TEMP}"
tar -C objs -xzf "${RUNNER_TEMP}/${ARCHIVE_NAME}"
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Restore Bun cache
id: bun-cache
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: &macos-build-ui-bun-cache-path |
~/.bun/install/cache
key: ${{ runner.os }}-${{ runner.arch }}-build-ui-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-build-ui-
- name: Build acton binary
env:
ACTON_RELEASE_CHANNEL: trunk
run: |
just build-ui
cargo build --release --locked --target "${TARGET_NAME}" --bin acton
- name: Add acton to PATH
run: echo "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release" >> "$GITHUB_PATH"
- name: Test acton binary
run: |
acton --help
- name: Run tests
run: |
just test
- name: Save Bun cache
if: github.ref == 'refs/heads/master' && steps.bun-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: *macos-build-ui-bun-cache-path
key: ${{ steps.bun-cache.outputs.cache-primary-key }}
- name: Prepare trunk archive
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
run: |
cargo xtask dist archive --target "${TARGET_NAME}" --profile release
- name: Upload trunk archive artifact
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: artifacts-${{ env.TARGET_NAME }}
path: |
acton-${{ env.TARGET_NAME }}.tar.gz
acton-${{ env.TARGET_NAME }}.tar.gz.sha256
retention-days: 1
if-no-files-found: error
- name: Check Acton target binary
shell: bash
# language=Bash
run: |
python3 "${GITHUB_WORKSPACE}/.github/scripts/check-rust-target-binary.py" \
--binary "${GITHUB_WORKSPACE}/target/${TARGET_NAME}/release/acton" \
--target "${TARGET_NAME}"
create-trunk-release:
name: Create Trunk Release
needs: [ build-linux, build-macos, lint, ui ]
runs-on: ubicloud-standard-2-ubuntu-2204
if: github.ref == 'refs/heads/master' && github.repository == 'ton-blockchain/acton' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
permissions:
actions: write
contents: write
steps:
- name: Download trunk archives
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: artifacts-*
path: artifacts
merge-multiple: true
- name: Delete download artifacts
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ github.token }}
# language=JavaScript
script: |
const {
data: artifacts,
} = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
});
if (artifacts.total_count === 0) {
core.warning('No downloadable artifacts to delete');
return;
} else {
core.info(`Found ${artifacts.total_count} artifacts to delete`);
}
for (const artifact of artifacts.artifacts) {
core.info(`Deleting artifact ${artifact.name} (${artifact.id})`);
await github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
});
}
- name: Display structure of downloaded files
run: ls -lhR artifacts
- name: Delete previous trunk
env:
GH_TOKEN: ${{ github.token }}
# language=Bash
run: |
gh release delete trunk --repo "${GITHUB_REPOSITORY}" --cleanup-tag -y || true
gh api repos/${GITHUB_REPOSITORY}/git/refs/tags/trunk -X DELETE || true
- name: Create trunk release
env:
GH_TOKEN: ${{ github.token }}
# language=Bash
run: |
release_notes=$(cat <<EOF
Automated trunk build of Acton.
Built from source commit: https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}
EOF
)
gh release create trunk \
--repo "${GITHUB_REPOSITORY}" \
artifacts/* \
--title "Trunk" \
--notes "${release_notes}" \
--target "${GITHUB_SHA}" \
--prerelease