forked from mirrors/jj
bd82ab3018
Bumps the github-dependencies group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action). Updates `actions/checkout` from 4.1.7 to 4.2.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](692973e3d9...d632683dd7
) Updates `github/codeql-action` from 3.26.8 to 3.26.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](294a9d9291...461ef6c76d
) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
147 lines
5.3 KiB
YAML
147 lines
5.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
permissions: read-all
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
jobs:
|
|
build-release:
|
|
name: build-release
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
build: [linux-x86_64-musl, linux-aarch64-musl, macos-x86_64, macos-aarch64, win-msvc]
|
|
include:
|
|
- build: linux-x86_64-musl
|
|
os: ubuntu-24.04
|
|
target: x86_64-unknown-linux-musl
|
|
- build: linux-aarch64-musl
|
|
os: ubuntu-24.04
|
|
target: aarch64-unknown-linux-musl
|
|
- build: macos-x86_64
|
|
os: macos-13
|
|
target: x86_64-apple-darwin
|
|
- build: macos-aarch64
|
|
os: macos-14
|
|
target: aarch64-apple-darwin
|
|
- build: win-msvc
|
|
os: windows-2022
|
|
target: x86_64-pc-windows-msvc
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
|
|
- name: Install packages (Ubuntu)
|
|
if: matrix.os == 'ubuntu-24.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
|
|
with:
|
|
toolchain: stable
|
|
target: ${{ matrix.target }}
|
|
- name: Download cross-compilation tool (linux-aarch64)
|
|
if: matrix.target == 'aarch64-unknown-linux-musl'
|
|
run: wget -c https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz -O - | tar -xz
|
|
- name: Build release binary
|
|
shell: bash
|
|
run: |
|
|
CARGO_CMD=cargo
|
|
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
|
|
CARGO_CMD=$PWD/cross
|
|
fi
|
|
$CARGO_CMD build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
|
|
- name: Build archive
|
|
shell: bash
|
|
run: |
|
|
outdir="target/${{ matrix.target }}/release"
|
|
staging="jj-${{ github.event.release.tag_name }}-${{ matrix.target }}"
|
|
mkdir "$staging"
|
|
cp {README.md,LICENSE} "$staging/"
|
|
if [ "${{ matrix.os }}" = "windows-2022" ]; then
|
|
cp "$outdir/jj.exe" "$staging/"
|
|
cd "$staging"
|
|
7z a "../$staging.zip" .
|
|
echo "ASSET=$staging.zip" >> $GITHUB_ENV
|
|
else
|
|
cp "$outdir/jj" "$staging/"
|
|
tar czf "$staging.tar.gz" -C "$staging" .
|
|
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
|
|
fi
|
|
- name: Upload release archive
|
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ${{ env.ASSET }}
|
|
asset_name: ${{ env.ASSET }}
|
|
asset_content_type: application/octet-stream
|
|
|
|
docs-release-archive:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Install packages (Ubuntu)
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
|
|
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
|
|
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install poetry
|
|
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
|
|
with:
|
|
poetry-version: latest
|
|
- name: Compile docs and zip them up
|
|
run: |
|
|
poetry install
|
|
poetry run -- mkdocs build -f mkdocs-offline.yml
|
|
archive="jj-${{ github.event.release.tag_name }}-docs-html.tar.gz"
|
|
tar czf "$archive" -C "rendered-docs" .
|
|
echo "ASSET=$archive" >> $GITHUB_ENV
|
|
- name: Upload release archive
|
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ${{ env.ASSET }}
|
|
asset_name: ${{ env.ASSET }}
|
|
asset_content_type: application/octet-stream
|
|
|
|
docs-deploy-website-latest-release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
|
|
- run: "git fetch origin gh-pages --depth=1"
|
|
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3
|
|
with:
|
|
python-version: 3.11
|
|
- name: Install poetry
|
|
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
|
|
with:
|
|
poetry-version: latest
|
|
- name: Install dependencies, compile and deploy docs to the "latest release" section of the website
|
|
run: |
|
|
git config user.name 'jj-docs[bot]'
|
|
git config user.email 'jj-docs[bot]@users.noreply.github.io'
|
|
# Using the 'latest' tag below makes the website default
|
|
# to this version.
|
|
.github/scripts/docs-build-deploy 'https://martinvonz.github.io/jj' "${{ github.event.release.tag_name }}" latest --update-aliases --push
|
|
- name: "Show `git diff --stat`"
|
|
run: git diff --stat gh-pages^ gh-pages || echo "(No diffs)"
|