Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 104 additions & 47 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
type: boolean
default: true

env:
NFPM_VERSION: "2.43.1"

concurrency:
# make publishing release concurrent (but others trigger not)
group: building-releases-${{ inputs.publish-release && 'prerelease' || github.run_id }}
Expand Down Expand Up @@ -240,9 +243,13 @@ jobs:
name: RHEL Zip
path: ./package/quarto-${{needs.configure.outputs.version}}-linux-rhel7-amd64.tar.gz

make-installer-arm64-deb:
make-installer-linux:
runs-on: ubuntu-latest
needs: [configure]
strategy:
matrix:
arch: [x86_64, aarch64]
format: [deb, rpm]
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -256,57 +263,47 @@ jobs:
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@v4
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@v4
with:
ref: ${{ needs.configure.outputs.version_commit }}

- name: Prevent Re-run
if: ${{ inputs.publish-release }}
uses: ./.github/workflows/actions/prevent-rerun

- name: Configure
- name: Install nfpm
run: |
./configure.sh
wget -q https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz
tar -xzf nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz
sudo mv nfpm /usr/local/bin/
nfpm --version

- name: Prepare Distribution
run: |
pushd package/src/
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} --log-level info
./quarto-bld prepare-dist --set-version ${{needs.configure.outputs.version}} ${{ matrix.arch == 'aarch64' && '--arch aarch64' || '' }} --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
./quarto-bld make-installer-${{ matrix.format }} --set-version ${{needs.configure.outputs.version}} ${{ matrix.arch == 'aarch64' && '--arch aarch64' || '' }} --log-level info
popd

- name: Set package architecture name
id: pkg_arch
run: |
if [ "${{ matrix.format }}" == "deb" ]; then
if [ "${{ matrix.arch }}" == "x86_64" ]; then
echo "arch_name=amd64" >> $GITHUB_OUTPUT
else
echo "arch_name=arm64" >> $GITHUB_OUTPUT
fi
else
if [ "${{ matrix.arch }}" == "x86_64" ]; then
echo "arch_name=x86_64" >> $GITHUB_OUTPUT
else
echo "arch_name=aarch64" >> $GITHUB_OUTPUT
fi
fi

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Deb Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
name: Linux-${{ matrix.format }}-${{ matrix.arch }}-Installer
path: ./package/out/quarto-${{needs.configure.outputs.version}}-linux-${{ steps.pkg_arch.outputs.arch_name }}.${{ matrix.format }}

test-tarball-linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -593,8 +590,7 @@ jobs:
runs-on: ubuntu-latest
needs: [
configure,
make-installer-deb,
make-installer-arm64-deb,
make-installer-linux,
make-installer-win,
make-installer-mac,
# optional in release to not be blocked by RHEL build depending on conda-forge deno dependency
Expand Down Expand Up @@ -660,13 +656,21 @@ jobs:
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.tar.gz >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Deb\ Installer
pushd Linux-deb-x86_64-Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-amd64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Deb\ Arm64\ Installer
pushd Linux-deb-aarch64-Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-arm64.deb >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd
popd

pushd Linux-rpm-x86_64-Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-x86_64.rpm >> ../quarto-${{needs.configure.outputs.version}}-checksums.txt
popd

pushd Linux-rpm-aarch64-Installer
sha256sum quarto-${{needs.configure.outputs.version}}-linux-aarch64.rpm >> ../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
Expand All @@ -690,8 +694,10 @@ jobs:
./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
./Linux-deb-x86_64-Installer/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
./Linux-deb-aarch64-Installer/quarto-${{needs.configure.outputs.version}}-linux-arm64.deb
./Linux-rpm-x86_64-Installer/quarto-${{needs.configure.outputs.version}}-linux-x86_64.rpm
./Linux-rpm-aarch64-Installer/quarto-${{needs.configure.outputs.version}}-linux-aarch64.rpm
./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
Expand All @@ -703,8 +709,7 @@ jobs:
if: ${{ (failure() || cancelled()) && inputs.publish-release }}
needs: [
configure,
make-installer-deb,
make-installer-arm64-deb,
make-installer-linux,
make-installer-win,
make-installer-mac,
# optional in release to not be blocked by RHEL build depending on conda-forge deno dependency
Expand Down Expand Up @@ -761,10 +766,62 @@ jobs:

- uses: ./.github/actions/docker
with:
source: ./Deb Installer/quarto-${{needs.configure.outputs.version}}-linux-amd64.deb
source: ./Linux-deb-x86_64-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 }}

cloudsmith-push:
if: ${{ inputs.publish-release }}
runs-on: ubuntu-latest
needs: [configure, publish-release]
strategy:
matrix:
arch: [x86_64, aarch64]
format: [deb, rpm]
repo: [open, pro]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github

- name: Prevent Re-run
if: ${{ inputs.publish-release }}
uses: ./.github/workflows/actions/prevent-rerun

- name: Download Artifacts
uses: actions/download-artifact@v4

- name: Set package file name
id: pkg_file
run: |
if [ "${{ matrix.format }}" == "deb" ]; then
if [ "${{ matrix.arch }}" == "x86_64" ]; then
echo "arch_name=amd64" >> $GITHUB_OUTPUT
else
echo "arch_name=arm64" >> $GITHUB_OUTPUT
fi
else
if [ "${{ matrix.arch }}" == "x86_64" ]; then
echo "arch_name=x86_64" >> $GITHUB_OUTPUT
else
echo "arch_name=aarch64" >> $GITHUB_OUTPUT
fi
fi

- name: Push ${{ matrix.format }} ${{ matrix.arch }} to Cloudsmith ${{ matrix.repo }}
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
format: "${{ matrix.format }}"
owner: "posit"
repo: "${{ matrix.repo }}"
distro: "any-distro"
release: "any-version"
republish: "true"
file: "./Linux-${{ matrix.format }}-${{ matrix.arch }}-Installer/quarto-${{needs.configure.outputs.version}}-linux-${{ steps.pkg_file.outputs.arch_name }}.${{ matrix.format }}"
51 changes: 51 additions & 0 deletions package/scripts/linux/rpm/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -e

# detect whether running as root (per machine installation)
# if per machine (run without sudo):

if [[ $EUID -eq 0 ]]; then
if [ -d "/usr/local/bin" ]
then
ln -fs /opt/quarto/bin/quarto /usr/local/bin/quarto
else
echo "Quarto symlink not created, please be sure that you add Quarto to your path."
fi

if [ -d "/usr/local/man/man1" ]
then
ln -fs /opt/quarto/share/man/quarto.man /usr/local/man/man1/quarto.1
elif [ -d "/usr/local/man" ]
then
ln -fs /opt/quarto/share/man/quarto.man /usr/local/man/quarto.1
fi

else
if [ -d "~/bin/quarto" ]
then
ln -fs /opt/quarto/bin/quarto ~/bin/quarto
else
echo "Quarto symlink not created, please be sure that you add Quarto to your path."
fi

if [ -d "~/man/man1" ]
then
ln -fs /opt/quarto/share/man/quarto.man ~/man/man1/quarto.1
elif [ -d "~/man" ]
then
ln -fs /opt/quarto/share/man/quarto.man ~/man/quarto.1
fi

fi

# Figure architecture
NIXARCH=$(uname -m)
if [[ $NIXARCH == "aarch64" ]]; then
ARCH_DIR=aarch64
else
ARCH_DIR=x86_64
fi

ln -fs /opt/quarto/bin/tools/${ARCH_DIR}/pandoc /opt/quarto/bin/tools/pandoc

exit 0
19 changes: 19 additions & 0 deletions package/scripts/linux/rpm/postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e

if [[ "$EUID" -eq 0 ]]
then
rm -f /usr/local/bin/quarto
else
rm -f ~/bin/quarto
fi

# Remove pandoc symlink created by postinst
# (before 1.4 this was a regular file that shouldn't be removed here)
pandoc=/opt/quarto/bin/tools/pandoc
if [ -h "$pandoc" ]
then
rm -f "$pandoc"
fi

exit 0
6 changes: 5 additions & 1 deletion package/src/bld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { mainRunner } from "../../src/core/main.ts";

import { prepareDist } from "./common/prepare-dist.ts";
import { updateHtmlDependencies } from "./common/update-html-dependencies.ts";
import { makeInstallerDeb } from "./linux/installer.ts";
import { makeInstallerDeb, makeInstallerRpm } from "./linux/installer.ts";
import { makeInstallerMac } from "./macos/installer.ts";
import {
compileQuartoLatexmkCommand,
Expand Down Expand Up @@ -96,6 +96,10 @@ function getCommands() {
packageCommand(makeInstallerDeb, "make-installer-deb")
.description("Builds Linux deb installer"),
);
commands.push(
packageCommand(makeInstallerRpm, "make-installer-rpm")
.description("Builds Linux rpm installer"),
);
commands.push(
packageCommand(makeInstallerWindows, "make-installer-win")
.description("Builds Windows installer"),
Expand Down
Loading
Loading