Skip to content

Build Installers

Build Installers #2446

name: Build Installers
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
inputs:
publish-release:
description: "Publish Release"
required: false
type: boolean
default: true
pre-release:
description: "Pre-release"
required: false
type: boolean
default: true
draft:
description: "Draft"
required: false
type: boolean
default: false
jobs:
configure:
runs-on: ubuntu-latest
outputs:
version: ${{steps.config.outputs.version}}.${{ steps.config.outputs.build_number}}
version_base: ${{steps.config.outputs.version}}
tag_name: v${{steps.config.outputs.version}}.${{ steps.config.outputs.build_number }}
release: v${{steps.config.outputs.version}}.${{ steps.config.outputs.build_number }}
changes: ${{ steps.config.outputs.changes }}
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'quarto-dev/quarto-cli')
steps:
- name: Install libc6-div
run: sudo apt-get install libc6-dev
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: config
id: config
run: |
source ./configuration
CHANGES=
# CHANGES=$(git log $(git describe --tags --abbrev=0)..HEAD --oneline)
# Escape \n, \r to preserve multiline variable
# See https://github.community/t/set-output-truncates-multiline-strings/16852/2
# CHANGES="${CHANGES//'%'/'%25'}"
# CHANGES="${CHANGES//$'\n'/'%0A'}"
# CHANGES="${CHANGES//$'\r'/'%0D'}"
# echo "changes=$CHANGES" >> $GITHUB_OUTPUT
QUARTO_BUILD_NUMBER=$(($QUARTO_BUILD_RUN_OFFSET + $GITHUB_RUN_NUMBER))
echo "version=$QUARTO_VERSION" >> $GITHUB_OUTPUT
echo "changes=$CHANGES" >> $GITHUB_OUTPUT
echo "build_number=$QUARTO_BUILD_NUMBER" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: News
path: ./news/changelog-${{steps.config.outputs.version}}.md
make-source-tarball:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Make Tarball
run: |
tar -zcvf quarto-${{needs.configure.outputs.version}}.tar.gz *
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Source
path: ./quarto-${{needs.configure.outputs.version}}.tar.gz
make-tarball:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Make Tarball
run: |
pushd package/
mv pkg-working quarto-${{needs.configure.outputs.version}}
tar -cvf quarto-${{needs.configure.outputs.version}}-linux-amd64.tar quarto-${{needs.configure.outputs.version}}
gzip quarto-${{needs.configure.outputs.version}}-linux-amd64.tar
mv quarto-${{needs.configure.outputs.version}} pkg-working
popd
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz
make-arm64-tarball:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd
- name: Make Tarball
run: |
pushd package/
mv pkg-working quarto-${{needs.configure.outputs.version}}
tar -cvf quarto-${{needs.configure.outputs.version}}-linux-arm64.tar quarto-${{needs.configure.outputs.version}}
gzip quarto-${{needs.configure.outputs.version}}-linux-arm64.tar
mv quarto-${{needs.configure.outputs.version}} pkg-working
popd
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Arm64 Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz
make-tarball-rhel:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Move Custom Deno
run: |
source ./configuration
echo Placing custom Deno ${DENO:1}. See available versions at https://anaconda.org/conda-forge/deno/files
curl -L https://anaconda.org/conda-forge/deno/${DENO:1}/download/linux-64/deno-${DENO:1}-he8a937b_0.conda --output deno.conda
unzip deno.conda
tar --use-compress-program=unzstd -xvf pkg-deno-${DENO:1}-he8a937b_0.tar.zst
cp bin/deno package/pkg-working/bin/tools/x86_64/deno
- name: Make Tarball
run: |
pushd package/
mv pkg-working quarto-${{needs.configure.outputs.version}}
tar -cvf quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar quarto-${{needs.configure.outputs.version}}
gzip quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar
mv quarto-${{needs.configure.outputs.version}} pkg-working
popd
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: RHEL Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar.gz
make-installer-arm64-deb:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd
- name: Make Installer
run: |
pushd package/src/
./quarto-bld make-installer-deb --set-version ${{needs.configure.outputs.version}} --arch aarch64 --log-level info
popd
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Arm64 Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-linux-arm64.deb
make-installer-deb:
runs-on: ubuntu-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Make Installer
run: |
pushd package/src/
./quarto-bld make-installer-deb --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Deb Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
test-tarball-linux:
runs-on: ubuntu-latest
needs: [configure, make-tarball]
steps:
- uses: actions/download-artifact@master
with:
name: Deb Zip
path: .
- run: |
tar -zxf quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz
echo "$GITHUB_WORKSPACE/quarto-${{needs.configure.outputs.version}}/bin" >> $GITHUB_PATH
- run: |
ls -R
echo $PATH
quarto check
quarto --paths
quarto --version
make-installer-win:
runs-on: windows-latest
needs: [configure]
steps:
- name: Configure Rust Tools
run: |
rustup.exe toolchain install 1.63.0 --component rustfmt --component clippy --no-self-update
rustup.exe default 1.63.0
- uses: actions/checkout@v3
- name: Configure
run: |
.\configure.cmd
- name: Prepare Distribution
run: |
pushd package\src\
.\quarto-bld.cmd prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Build Launcher
run: |
cargo build --release --all-features --manifest-path package/launcher/Cargo.toml
cp package/launcher/target/release/quarto.exe package/pkg-working/bin/quarto.exe
- name: Make Installer
run: |
pushd package\src\
.\quarto-bld.cmd make-installer-win --set-version ${{needs.configure.outputs.version}} --log-level debug
popd
env:
QUARTO_WIN_PFX: ${{ secrets.WIN_PFX }}
QUARTO_WIN_PFX_PW: ${{ secrets.WIN_PFX_PW }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Windows Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-win.msi
- name: Upload Zip
uses: actions/upload-artifact@v3
with:
name: Windows Zip
path: ./package/out/quarto-${{needs.configure.outputs.version}}-win.zip
test-zip-win:
runs-on: windows-latest
needs: [configure, make-installer-win]
steps:
- uses: actions/download-artifact@master
with:
name: Windows Zip
path: .
- run: |
tar -xf quarto-${{needs.configure.outputs.version}}-win.zip
- run: Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\bin"
- run: |
quarto check
quarto --paths
quarto --version
make-installer-mac:
runs-on: macos-latest
needs: [configure]
steps:
- uses: actions/checkout@v3
- name: Configure
run: |
./configure.sh
- uses: ./.github/workflows/actions/keychain
with:
certificate-value: ${{ secrets.APPLE_SIGN_P12 }}
certificate-password: ${{ secrets.APPLE_SIGN_PW }}
keychain: "build.keychain"
keychain-pw: ${{ secrets.APPLE_KEYCHAIN_PW }}
certificate-file: certificate.p12
- uses: ./.github/workflows/actions/keychain
with:
certificate-value: ${{ secrets.APPLE_INSTALLER_P12 }}
certificate-password: ${{ secrets.APPLE_INSTALLER_PW }}
keychain: "build.keychain"
keychain-pw: ${{ secrets.APPLE_KEYCHAIN_PW }}
certificate-file: installer.p12
- name: Prepare Distribution
run: |
security find-identity
security find-certificate -a
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
popd
- name: Make Installer
run: |
pushd package/src/
./quarto-bld make-installer-mac --set-version ${{needs.configure.outputs.version}} --log-level info
popd
env:
QUARTO_APPLE_APP_DEV_ID: ${{ secrets.APPLE_SIGN_ID }}
QUARTO_APPLE_INST_DEV_ID: ${{ secrets.APPLE_INSTALLER_ID }}
QUARTO_APPLE_CONNECT_TEAMID: ${{ secrets.APPLE_CONNECT_TEAMID }}
QUARTO_APPLE_CONNECT_UN: ${{ secrets.APPLE_CONNECT_UN }}
QUARTO_APPLE_CONNECT_PW: ${{ secrets.APPLE_CONNECT_PW }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Mac Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-macos.pkg
- name: Upload Zip
uses: actions/upload-artifact@v3
with:
name: Mac Zip
path: ./package/out/quarto-${{needs.configure.outputs.version}}-macos.tar.gz
- name: Cleanup Keychain
if: ${{ always() }}
run: |
security delete-keychain build.keychain
test-zip-mac:
runs-on: macos-latest
needs: [configure, make-installer-mac]
steps:
- uses: actions/download-artifact@master
with:
name: Mac Zip
path: .
- run: |
tar -zxf quarto-${{needs.configure.outputs.version}}-macos.tar.gz
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- run: ls -R
- run: echo $PATH
- run: |
quarto check
quarto --paths
quarto --version
publish-release:
if: ${{ inputs.publish-release }}
runs-on: ubuntu-latest
needs:
[
configure,
make-installer-deb,
make-installer-arm64-deb,
make-installer-win,
make-installer-mac,
make-tarball-rhel,
make-arm64-tarball,
make-tarball,
make-source-tarball,
test-zip-win,
test-zip-mac,
test-tarball-linux,
]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- name: Rename news
run: |
ls -la ./News
mv ./News/changelog-${{needs.configure.outputs.version_base}}.md ./News/changelog.md
- name: Generate Checksums
id: generate_checksum
run: |
pushd Windows\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-win.msi >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Windows\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-win.zip >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Mac\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-macos.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Mac\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-macos.pkg >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd RHEL\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Deb\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Deb\ Arm64\ Zip
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Deb\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-amd64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Deb\ Arm64\ Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
pushd Source
sha256sum quarto-${{needs.configure.outputs.version}}.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{needs.configure.outputs.tag_name}}
name: ${{needs.configure.outputs.release}}
body: |
${{ needs.configure.outputs.changes }}
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.pre-release }}
files: |
./Source/quarto-${{needs.configure.outputs.version}}.tar.gz
./Deb Zip/quarto-${{needs.configure.outputs.version}}-linux-amd64.tar.gz
./Deb Arm64 Zip/quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz
./RHEL Zip/quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar.gz
./Deb Installer/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
./Deb Arm64 Installer/quarto-${{needs.configure.outputs.version}}-linux-arm64.deb
./Windows Installer/quarto-${{needs.configure.outputs.version}}-win.msi
./Windows Zip/quarto-${{needs.configure.outputs.version}}-win.zip
./Mac Installer/quarto-${{needs.configure.outputs.version}}-macos.pkg
./Mac Zip/quarto-${{needs.configure.outputs.version}}-macos.tar.gz
./News/changelog.md
quarto-${{needs.configure.outputs.version}}-checksums.txt
docker-push:
if: ${{ inputs.publish-release }}
runs-on: ubuntu-latest
needs: [configure, publish-release]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
- uses: quarto-dev/quarto-cli/.github/actions/docker@main
with:
source: ./Deb Installer/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
version: ${{needs.configure.outputs.version}}
token: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
org: ${{ github.repository_owner }}
name: quarto
daily: ${{ inputs.pre-release }}