2022-03-14 05:48:29 +00:00
|
|
|
name: Release
|
2022-03-16 19:18:01 +00:00
|
|
|
|
2022-03-13 05:50:04 +00:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
2022-03-16 19:18:01 +00:00
|
|
|
|
|
|
|
permissions: read-all
|
|
|
|
|
2023-07-10 07:01:17 +00:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
|
2022-03-13 05:50:04 +00:00
|
|
|
jobs:
|
2022-03-14 05:48:29 +00:00
|
|
|
build-release:
|
|
|
|
name: build-release
|
2022-03-16 19:18:01 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2022-03-13 05:50:04 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-03-14 05:48:29 +00:00
|
|
|
build: [linux-musl, macos, win-msvc]
|
2022-03-13 05:50:04 +00:00
|
|
|
include:
|
2022-03-14 05:48:29 +00:00
|
|
|
- build: linux-musl
|
|
|
|
os: ubuntu-20.04
|
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
|
- build: macos
|
|
|
|
os: macos-11
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- build: win-msvc
|
|
|
|
os: windows-2022
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.os }}
|
2022-03-13 05:50:04 +00:00
|
|
|
steps:
|
2022-03-14 05:48:29 +00:00
|
|
|
- name: Checkout repository
|
2023-08-24 15:23:20 +00:00
|
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
|
2022-03-14 05:48:29 +00:00
|
|
|
- name: Install packages (Ubuntu)
|
|
|
|
if: matrix.os == 'ubuntu-20.04'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
|
|
|
|
- name: Install Rust
|
2023-06-26 15:59:54 +00:00
|
|
|
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e
|
2022-03-14 05:48:29 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Build release binary
|
2023-07-12 16:18:30 +00:00
|
|
|
run: cargo build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
|
2022-03-14 05:48:29 +00:00
|
|
|
- name: Build archive
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-10-18 03:56:59 +00:00
|
|
|
outdir="target/${{ matrix.target }}/release"
|
2022-03-14 05:48:29 +00:00
|
|
|
staging="jj-${{ github.event.release.tag_name }}-${{ matrix.target }}"
|
2022-10-18 03:56:59 +00:00
|
|
|
mkdir "$staging"
|
2022-03-14 05:48:29 +00:00
|
|
|
cp {README.md,LICENSE} "$staging/"
|
|
|
|
if [ "${{ matrix.os }}" = "windows-2022" ]; then
|
2022-10-18 03:56:59 +00:00
|
|
|
cp "$outdir/jj.exe" "$staging/"
|
2022-03-14 05:48:29 +00:00
|
|
|
cd "$staging"
|
|
|
|
7z a "../$staging.zip" .
|
|
|
|
echo "ASSET=$staging.zip" >> $GITHUB_ENV
|
|
|
|
else
|
2022-10-18 03:56:59 +00:00
|
|
|
cp "$outdir/jj" "$staging/"
|
2022-03-14 05:48:29 +00:00
|
|
|
tar czf "$staging.tar.gz" -C "$staging" .
|
|
|
|
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
|
|
|
|
fi
|
|
|
|
- name: Upload release archive
|
2022-03-17 03:58:04 +00:00
|
|
|
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
|
2022-03-13 05:50:04 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-14 05:48:29 +00:00
|
|
|
with:
|
|
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
|
|
asset_path: ${{ env.ASSET }}
|
|
|
|
asset_name: ${{ env.ASSET }}
|
|
|
|
asset_content_type: application/octet-stream
|
2023-08-26 02:52:47 +00:00
|
|
|
|
2023-08-30 04:55:21 +00:00
|
|
|
docs-deploy-website-latest-release:
|
|
|
|
runs-on: ubuntu-latest
|
2023-08-26 02:52:47 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- run: "git fetch origin gh-pages --depth=1"
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.11
|
|
|
|
- name: Install poetry
|
|
|
|
uses: abatilo/actions-poetry@v2
|
|
|
|
with:
|
|
|
|
poetry-version: latest
|
2023-08-30 04:55:21 +00:00
|
|
|
- name: Install dependencies, compile and deploy docs to the "latest release" section of the website
|
2023-08-26 02:52:47 +00:00
|
|
|
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)"
|