This includes new binary releases for Linux aarch64 and Windows aarch64.
Closes #1579. See also discussion #1310.
on:
push:
pull_request:
+ workflow_dispatch:
+ inputs:
+ test_tag:
+ description: 'Optional tag name to simulate release'
+ required: false
env:
CTEST_OUTPUT_ON_FAILURE: ON
name: ${{ matrix.name }} - testdir.tar.xz
path: testdir.tar.xz
+ build_release:
+ name: Build release
+ needs:
+ - build_darwin_binary
+ - build_linux_aarch64_binary
+ - build_linux_x86_64_binary
+ - build_windows_binary
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Prepare environment
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y minisign
+
+ - name: Get source
+ uses: actions/checkout@v4
+
+ - name: Download binaries
+ uses: actions/download-artifact@v5
+ with:
+ pattern: "*-binary"
+
+ - name: Download docs
+ uses: actions/download-artifact@v5
+ with:
+ pattern: docs
+ path: docs
+
+ - name: Build release
+ run: ci/prepare-release
+
+ - name: Sign release archives
+ if: env.MINISIGN_KEY != ''
+ env:
+ MINISIGN_KEY: ${{ secrets.MINISIGN_KEY }}
+ run: |
+ mkdir -p ~/.minisign
+ echo "${MINISIGN_KEY}" | base64 -d > ~/.minisign/minisign.key
+ minisign -Sm release/*
+
+ - name: Upload release
+ uses: actions/upload-artifact@v4
+ if: ${{ github.ref_type == 'tag' || github.event.inputs.test_tag != '' }}
+ with:
+ name: release
+ path: release
+ retention-days: 3
+
+ create_release:
+ name: Create release
+ needs:
+ - build_release
+ permissions:
+ contents: write
+ if: ${{ github.ref_type == 'tag' || github.event.inputs.test_tag != '' }}
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Get source
+ uses: actions/checkout@v4
+ - name: Download release
+ uses: actions/download-artifact@v5
+ with:
+ name: release
+ path: release
+ - name: Create release notes
+ run: |
+ TAG_NAME="${{ github.event.inputs.test_tag || github.ref_name }}"
+ ci/generate-release-notes "${TAG_NAME}" >release-notes.md
+ - name: Create GitHub Release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ TAG_NAME="${{ github.event.inputs.test_tag || github.ref_name }}"
+ gh release create "${TAG_NAME}" \
+ --draft \
+ --notes-file release-notes.md \
+ --title "${TAG_NAME}" \
+ release/*
+
check_format:
timeout-minutes: 30
name: Code formatting
--- /dev/null
+#!/bin/bash
+
+set -euo pipefail
+
+version=$(echo "$1" | sed 's/^v//')
+u_version=$(echo "${version}" | sed 's/\./_/g')
+url_prefix="https://github.com/ccache/ccache/releases/download/v${version}"
+
+source_extensions=(tar.gz tar.xz)
+linux_archs=(aarch64 x86_64)
+windows_archs=(aarch64 i686 x86_64)
+
+retcode=0
+
+add() {
+ local descr=$1
+ local file=$2
+
+ for f in "${file}" "${file}.minisig"; do
+ if [[ ! -f "${f}" ]]; then
+ echo "Error: ${f} does not exist" >&2
+ retcode=1
+ fi
+ done
+cat <<EOF
+* [${descr}](${url_prefix}/${file}) ([signature](${url_prefix}/${file}.minisig))
+EOF
+}
+
+cd release
+
+for ext in "${source_extensions[@]}"; do
+ add "Generic source code release (${ext})" "ccache-${version}.${ext}"
+done
+add "Darwin (macOS) universal binary release" "ccache-${version}-darwin.tar.gz"
+for arch in "${linux_archs[@]}"; do
+ add "Linux ${arch} binary release" "ccache-${version}-linux-${arch}.tar.xz"
+done
+for arch in "${windows_archs[@]}"; do
+ add "Windows ${arch} binary release" "ccache-${version}-windows-${arch}.zip"
+done
+
+cat <<EOF
+* [Release notes](https://ccache.dev/releasenotes.html#_ccache_${u_version})
+* [Manual](https://ccache.dev/manual/${version}.html)
+EOF
+
+exit "${retcode}"
--- /dev/null
+#!/bin/bash
+
+set -euxo pipefail
+
+if [[ ${GITHUB_REF} = refs/tags/v* ]]; then
+ VERSION=${GITHUB_REF#refs/tags/v}
+else
+ VERSION=${GITHUB_REF_NAME}.$(git rev-parse --short=8 @)
+fi
+
+prepare_source_release() {
+ local name="ccache-${VERSION}"
+ local tarfile="release/${name}.tar"
+ git archive --prefix="${name}/" -o "${tarfile}" HEAD
+ gzip --keep -9 "${tarfile}"
+ xz --keep -9 "${tarfile}"
+ rm "${tarfile}"
+}
+
+prepare_posix_binary_release() {
+ local arch=$1
+ local compression=$2
+
+ local name="ccache-${VERSION}-${arch}"
+ mkdir "${name}"
+ cp "${arch}-binary/ccache" "${name}"
+ chmod +x "${name}/ccache"
+ cp misc/Makefile.posix-binary-release "${name}/Makefile"
+ cp docs/install/share/doc/ccache/* "${name}"
+ cp docs/install/share/man/man1/ccache.1 "${name}"
+ tar -caf "release/${name}.tar.${compression}" "${name}"
+}
+
+prepare_windows_binary_release() {
+ local arch=$1
+
+ local name="ccache-${VERSION}-${arch}"
+ mkdir "${name}"
+ cp "${arch}-binary/ccache.exe" "${name}"
+ cp docs/install/share/doc/ccache/* "${name}"
+ zip -r "release/${name}.zip" "${name}"
+}
+
+mkdir release
+
+prepare_source_release
+
+prepare_posix_binary_release darwin gz
+prepare_posix_binary_release linux-aarch64 xz
+prepare_posix_binary_release linux-x86_64 xz
+
+prepare_windows_binary_release windows-aarch64
+prepare_windows_binary_release windows-i686
+prepare_windows_binary_release windows-x86_64
+
+ls -l . release
--- /dev/null
+prefix = /usr/local
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+datarootdir = $(prefix)/share
+docdir = $(datarootdir)/doc/ccache
+mandir = $(datarootdir)/man
+man1dir = $(mandir)/man1
+sysconfdir = $(prefix)/etc
+
+default_sysconfdir = /usr/local/etc
+doc_files = \
+ LICENSE.adoc \
+ LICENSE.html \
+ MANUAL.adoc \
+ MANUAL.html \
+ NEWS.adoc \
+ NEWS.html \
+ GPL-3.0.txt \
+ LICENSE.adoc \
+ README.md
+
+PYTHON = python3
+
+all:
+ @echo "Available make targets:"
+ @echo
+ @echo " install [prefix=...] [DESTDIR=...]"
+ @echo
+ @echo "Default prefix: $(prefix)"
+
+install:
+ mkdir -p "$(DESTDIR)$(bindir)"
+ $(PYTHON) -c 'import sys; sysconfdir = b"$(sysconfdir)"; default_sysconfdir = b"$(default_sysconfdir)"; sys.stdout.buffer.write(sys.stdin.buffer.read().replace(default_sysconfdir + b"\x00" * (4096 - len(default_sysconfdir)), sysconfdir + b"\x00" * (4096 - len(sysconfdir))))' <ccache >"$(DESTDIR)$(bindir)/ccache"
+ chmod +x "$(DESTDIR)$(bindir)/ccache"
+
+ mkdir -p "$(DESTDIR)$(docdir)"
+ cp $(doc_files) "$(DESTDIR)$(docdir)"
+
+ mkdir -p "$(DESTDIR)$(man1dir)"
+ cp ccache.1 "$(DESTDIR)$(man1dir)"