Skip to content

Tag and Release

Tag and Release #200

Workflow file for this run

name: Tag and Release
on:
push:
branches: [ "release" ]
workflow_dispatch:
inputs:
skip_checks:
type: boolean
default: false
skip_tests:
type: boolean
default: false
cancel_tag:
type: boolean
default: false
skip_tag:
type: boolean
default: false
skip_release:
type: boolean
default: false
skip_doc:
type: boolean
default: false
skip_crates:
type: boolean
default: false
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings'
RUSTDOCFLAGS: '--deny=warnings'
CARGO_TERM_COLOR: always
ZNG_TP_LICENSES: false
NEXTEST_RETRIES: 3
jobs:
check-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean # to print size
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do l10n --all --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-windows:
runs-on: windows-latest
env:
CC: 'clang-cl'
CXX: 'clang-cl'
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do version --verbose
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do fmt --check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do check
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo do clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo check --workspace --examples --tests --release
if: ${{ github.event.inputs.skip_checks != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_checks != 'true' }}
check-android:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_checks != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_checks != 'true' }}
with:
targets: aarch64-linux-android, armv7-linux-androideabi
- name: install cargo-ndk
if: ${{ github.event.inputs.skip_checks != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-ndk
- run: cargo do build-apk multi
if: ${{ github.event.inputs.skip_checks != 'true' }}
prebuild-ubuntu:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
features: --features avif
# - target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
needs: [check-ubuntu]
env:
ZNG_TP_LICENSES: true
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install dav1d dep nasm
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
run: |
pip install -U pip --break-system-packages
pip install -U wheel setuptools --break-system-packages
pip install -U meson ninja --break-system-packages
- name: build dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
env:
DAV1D_DIR: dav1d_dir
LIB_PATH: lib/x86_64-linux-gnu
# dav1d version must be set in crates/zng-view/build.rs too.
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- name: install aarch64 deps
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: sudo apt-get install g++-aarch64-linux-gnu
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
with:
target: ${{ matrix.target }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-unknown-linux-gnu' }}
- name: cargo do prebuild ${{ matrix.features }}
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.so
path: crates/zng-view-prebuilt/lib/libzng_view.${{ matrix.target }}.so
if-no-files-found: error
prebuild-windows:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
features: --features avif
- target: aarch64-pc-windows-msvc
runs-on: windows-latest
needs: [check-windows]
env:
ZNG_TP_LICENSES: true
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: config msvc for dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
uses: ilammy/msvc-dev-cmd@v1
- name: install dav1d dep nasm
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
pip install -U pip --break-system-packages
pip install -U wheel setuptools --break-system-packages
pip install -U meson ninja --break-system-packages
- name: setup dav1d env
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
shell: bash
run: |
echo "PKG_CONFIG=c:\build\bin\pkg-config.exe" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=C:\build\lib\pkgconfig" >> $GITHUB_ENV
echo "C:\build\bin" >> $GITHUB_PATH
- name: build dav1d dep pkg-config
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
git clone --branch meson-glib-subproject --depth 1 https://gitlab.freedesktop.org/tpm/pkg-config.git
cd pkg-config
meson build -Dprefix=C:\build --buildtype release
ninja -C build
ninja -C build install
- name: build dav1d
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=C:\build -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
with:
target: ${{ matrix.target }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ (github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true') && matrix.target == 'x86_64-pc-windows-msvc' }}
- name: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
CC: clang-cl
CXX: clang-cl
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --target ${{ matrix.target }} ${{ matrix.features }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: zng_view.${{ matrix.target }}.dll
path: crates/zng-view-prebuilt/lib/zng_view.${{ matrix.target }}.dll
if-no-files-found: error
prebuild-macos:
strategy:
fail-fast: false
matrix:
include:
- os: macOS-13
target: x86_64-apple-darwin
- os: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
needs: [check-macos]
env:
ZNG_TP_LICENSES: true
steps:
- name: install cargo-about
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- name: install dav1d dep nasm
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: ilammy/setup-nasm@v1
- name: install dav1d python deps
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
run: |
pip install -U pip --break-system-packages
pip install -U wheel setuptools --break-system-packages
pip install -U meson ninja --break-system-packages
- name: build dav1d
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
DAV1D_DIR: dav1d_dir
LIB_PATH: lib
run: |
git clone --branch 1.3.0 --depth 1 https://github.com/videolan/dav1d.git
cd dav1d
meson build -Dprefix=$HOME/$DAV1D_DIR -Denable_tools=false -Denable_examples=false -Ddefault_library=static --buildtype release
ninja -C build
ninja -C build install
echo "PKG_CONFIG_PATH=$HOME/$DAV1D_DIR/$LIB_PATH/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$HOME/$DAV1D_DIR/$LIB_PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- run: cargo do comment_feature -u "crates/zng-view/Cargo.toml" avif
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: cargo do prebuild --features avif
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
env:
SYSTEM_DEPS_LINK: static
run: cargo do prebuild --features avif
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
- name: upload prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' || github.event.inputs.skip_release != 'true' }}
uses: actions/upload-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.dylib
path: crates/zng-view-prebuilt/lib/libzng_view.${{ matrix.target }}.dylib
if-no-files-found: error
doc-ubuntu:
runs-on: ubuntu-latest
needs: [check-ubuntu]
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_doc != 'true' }}
- run: cargo do latest_release_changes release-changes.md
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
name: release-changes.md
path: release-changes.md
if-no-files-found: error
- run: cargo do doc
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/upload-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
name: doc
path: target/doc
if-no-files-found: error
- run: cargo clean
if: ${{ github.event.inputs.skip_doc != 'true' }}
test-ubuntu:
runs-on: ubuntu-latest
needs: [prebuild-ubuntu]
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: libzng_view.x86_64-unknown-linux-gnu.so
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- name: install winit deps
if: ${{ github.event.inputs.skip_tests != 'true' }}
run: |
sudo apt-get update
sudo apt install libxkbcommon-x11-0
- name: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
with:
run: cargo do test --render
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-windows:
runs-on: windows-latest
needs: [prebuild-windows]
env:
CC: 'clang-cl'
CXX: 'clang-cl'
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: zng_view.x86_64-pc-windows-msvc.dll
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-macos:
strategy:
fail-fast: false
matrix:
include:
- os: macOS-13
target: x86_64-apple-darwin
- os: macOS-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
needs: [prebuild-macos]
steps:
- name: install cargo-nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
with:
components: rust-src
- name: install prebuilt
if: ${{ github.event.inputs.skip_tests != 'true' }}
uses: actions/download-artifact@v4
with:
name: libzng_view.${{ matrix.target }}.dylib
path: crates/zng-view-prebuilt/lib
- run: cargo do test --nextest
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --doc
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --macro --all
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do test --render
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo clean
if: ${{ github.event.inputs.skip_tests != 'true' }}
test-cargo-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_tests != 'true' }}
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_tests != 'true' }}
- run: cargo do publish --test
if: ${{ github.event.inputs.skip_tests != 'true' }}
tag:
runs-on: ubuntu-latest
needs: [test-ubuntu, test-windows, test-macos, test-cargo-publish, doc-ubuntu, check-android]
if: ${{ github.event.inputs.cancel_tag != 'true' && github.event.ref == 'refs/heads/release' }}
permissions:
contents: write
outputs:
tag_name: ${{ steps.publish_version_tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_tag != 'true' }}
with:
fetch-depth: 0
- id: publish_version_tag
if: ${{ github.event.inputs.skip_tag != 'true' }}
run: cargo do publish_version_tag --execute | tail -n 1 >> "$GITHUB_OUTPUT"
publish-release:
runs-on: ubuntu-latest
needs: [tag]
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: release-changes.md
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.x86_64-unknown-linux-gnu.so
path: prebuilt-ubuntu-x64
# - uses: actions/download-artifact@v4
# if: ${{ github.event.inputs.skip_release != 'true' }}
# with:
# name: libzng_view.aarch64-unknown-linux-gnu.so
# path: prebuilt-ubuntu-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: zng_view.x86_64-pc-windows-msvc.dll
path: prebuilt-windows-x64
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: zng_view.aarch64-pc-windows-msvc.dll
path: prebuilt-windows-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.aarch64-apple-darwin.dylib
path: prebuilt-macos-arm
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_release != 'true' }}
with:
name: libzng_view.x86_64-apple-darwin.dylib
path: prebuilt-macos-x64
- name: compress
if: ${{ github.event.inputs.skip_release != 'true' }}
run: |
mkdir prebuilt
tar -czf "prebuilt/libzng_view.x86_64-unknown-linux-gnu.so.tar.gz" -C "prebuilt-ubuntu-x64/" .
tar -czf "prebuilt/zng_view.x86_64-pc-windows-msvc.dll.tar.gz" -C "prebuilt-windows-x64/" .
tar -czf "prebuilt/zng_view.aarch64-pc-windows-msvc.dll.tar.gz" -C "prebuilt-windows-arm/" .
tar -czf "prebuilt/libzng_view.x86_64-apple-darwin.dylib.tar.gz" -C "prebuilt-macos-x64/" .
tar -czf "prebuilt/libzng_view.aarch64-apple-darwin.dylib.tar.gz" -C "prebuilt-macos-arm/" .
- run: ls --all ./prebuilt
if: ${{ github.event.inputs.skip_release != 'true' }}
- name: publish release
if: ${{ github.event.inputs.skip_release != 'true' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.tag.outputs.tag_name }}
artifacts: "prebuilt/*"
bodyFile: release-changes.md
publish-doc:
runs-on: ubuntu-latest
needs: [tag]
permissions:
contents: write
env:
HAS_CHANGES: 0
steps:
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
with:
repository: zng-ui/zng-ui.github.io
ref: main
token: ${{ secrets.PAGES_DOC_PUSH_TOKEN }}
- run: rm -rf doc
if: ${{ github.event.inputs.skip_doc != 'true' }}
- uses: actions/download-artifact@v4
if: ${{ github.event.inputs.skip_doc != 'true' }}
name: push
with:
name: doc
path: doc
- run: |
set +e
git diff --cached --quiet
echo "HAS_CHANGES=$?" >> $GITHUB_ENV
- run: |
git config user.name "$(git log -n 1 --pretty=format:%an)"
git config user.email "$(git log -n 1 --pretty=format:%ae)"
git add -A
git commit -m ${{ needs.tag.outputs.tag_name }} --quiet
git push
if: ${{ env.HAS_CHANGES && github.event.inputs.skip_doc != 'true' }}
publish-crates:
runs-on: ubuntu-latest
needs: [publish-release, publish-doc]
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: dtolnay/rust-toolchain@stable
if: ${{ github.event.inputs.skip_crates != 'true' }}
- uses: actions/checkout@v4
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: sudo apt install libfontconfig1-dev
if: ${{ github.event.inputs.skip_crates != 'true' }}
- run: cargo do publish --execute ${{ github.run_attempt > 1 && '--no-burst' || '' }}
if: ${{ github.event.inputs.skip_crates != 'true' }}
cleanup:
runs-on: ubuntu-latest
if: always()
needs: [publish-release, publish-doc]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: |
*zng_view*
doc
release-changes.md
failOnError: false