chore(deps): bump toml from 1.1.4+spec-1.1.0 to 1.1.6+spec-1.1.0 (#5) #51
This file contains hidden or 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: Sync source repositories | |
| on: | |
| schedule: | |
| - cron: '17,47 * * * *' | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'scripts/sync-sources.py' | |
| - 'core/tabs/commander/catalog*' | |
| - 'core/tabs/commander/catalogs/**' | |
| - 'core/tabs/commander/generated/**' | |
| - 'tests/test_source_sync.py' | |
| - '.github/workflows/sync-sources.yml' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: source-sync-${{ github.event.pull_request.number || 'main' }} | |
| cancel-in-progress: false | |
| jobs: | |
| sync: | |
| if: github.repository == 'Commanderx-code/commander-toolbox' && github.event_name != 'pull_request' | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| ref: main | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Adopt sources with successful CI | |
| id: sync | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: python3 -B scripts/sync-sources.py | |
| - name: Check whether the current revision has a build | |
| id: release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| revision=$(git rev-parse HEAD) | |
| if [ "$(gh release view "toolbox-${revision:0:12}" --json isDraft --jq .isDraft 2>/dev/null)" = false ]; then | |
| echo 'exists=true' >> "$GITHUB_OUTPUT" | |
| else | |
| echo 'exists=false' >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Install validation tools | |
| if: steps.sync.outputs.changed == 'true' || steps.release.outputs.exists != 'true' || github.event_name != 'schedule' | |
| run: sudo apt-get update && sudo apt-get install -y shellcheck devscripts python3 fish | |
| - name: Validate and build without installation | |
| if: steps.sync.outputs.changed == 'true' || steps.release.outputs.exists != 'true' || github.event_name != 'schedule' | |
| run: | | |
| rustup toolchain install stable --profile minimal | |
| rustup default stable | |
| python3 -B -m unittest discover -s tests -v | |
| shellcheck core/tabs/commander/common.sh core/tabs/commander/catalog-install.sh core/tabs/commander/terminal-tool.sh core/tabs/commander/netwatch.sh core/tabs/commander/tfm.sh core/tabs/commander/cassette.sh | |
| checkbashisms core/tabs/commander/catalog-install.sh core/tabs/commander/terminal-tool.sh core/tabs/commander/netwatch.sh core/tabs/commander/tfm.sh core/tabs/commander/cassette.sh | |
| cargo test --locked --no-fail-fast --package linutil_core | |
| cargo xtask docgen | |
| git diff --check | |
| cargo build --locked --release --package linutil_tui | |
| target/release/commander-toolbox --help >/dev/null | |
| - name: Commit tested source updates | |
| if: steps.sync.outputs.changed == 'true' | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add core/tabs/commander/common.sh core/tabs/commander/catalogs core/tabs/applications-setup/tab_data.toml docs/content/userguide/walkthrough.md | |
| git add -A core/tabs/commander/generated | |
| git commit -m 'Sync tested dotfiles and Myfish sources' | |
| # A concurrent human push stops this run; never force or publish an unpushed build. | |
| git push origin HEAD:main | |
| - name: Publish the tested Linux x86_64 build | |
| if: steps.sync.outputs.changed == 'true' || steps.release.outputs.exists != 'true' || github.event_name != 'schedule' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| revision=$(git rev-parse HEAD) | |
| tag="toolbox-${revision:0:12}" | |
| mkdir -p /tmp/toolbox-release | |
| cp target/release/commander-toolbox /tmp/toolbox-release/commander-toolbox-linux-x86_64 | |
| python3 -B scripts/sync-sources.py --render | |
| git diff --exit-code | |
| cd /tmp/toolbox-release | |
| sha256sum commander-toolbox-linux-x86_64 > SHA256SUMS | |
| printf 'Automatic build from Toolbox commit %s.\n\nLinux x86_64; built on Ubuntu 22.04 (glibc 2.35 or newer).\nUpdate Toolbox, then run the desired installer to apply configuration changes.\n' "$revision" > release-notes.md | |
| # Draft first: a failed upload never exposes a partial release as the latest build. | |
| if ! gh release view "$tag" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then | |
| gh release create "$tag" --repo "$GITHUB_REPOSITORY" --target "$revision" --draft --title "Toolbox ${revision:0:12}" --notes-file release-notes.md | |
| fi | |
| gh release upload "$tag" commander-toolbox-linux-x86_64 SHA256SUMS --clobber --repo "$GITHUB_REPOSITORY" | |
| gh release edit "$tag" --draft=false --latest --repo "$GITHUB_REPOSITORY" | |
| validate-pr: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | |
| with: | |
| python-version: "3.12" | |
| - run: sudo apt-get update && sudo apt-get install -y shellcheck devscripts python3 fish | |
| - run: | | |
| rustup toolchain install stable --profile minimal | |
| rustup default stable | |
| python3 -B -m unittest discover -s tests -v | |
| python3 -B scripts/sync-sources.py --render | |
| cargo test --locked --no-fail-fast --package linutil_core | |
| cargo xtask docgen | |
| git diff --exit-code | |
| shellcheck core/tabs/commander/common.sh core/tabs/commander/catalog-install.sh core/tabs/commander/terminal-tool.sh core/tabs/commander/netwatch.sh core/tabs/commander/tfm.sh core/tabs/commander/cassette.sh | |
| checkbashisms core/tabs/commander/catalog-install.sh core/tabs/commander/terminal-tool.sh core/tabs/commander/netwatch.sh core/tabs/commander/tfm.sh core/tabs/commander/cassette.sh |