name: Release tarball on: release: types: [created] permissions: contents: write statuses: read jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.release.tag_name }} - name: Check autotools status id: check_status uses: actions/github-script@v9 with: script: | const owner = context.repo.owner; const repo = context.repo.repo; const tagName = context.payload.release.tag_name; const tagRef = await github.rest.git.getRef({ owner, repo, ref: `tags/${tagName}` }); let releaseCommit = tagRef.data.object.sha; if (tagRef.data.object.type === 'tag') { const tag = await github.rest.git.getTag({ owner, repo, tag_sha: releaseCommit }); releaseCommit = tag.data.object.sha; } const status = await github.rest.repos.getCombinedStatusForRef({ owner, repo, ref: releaseCommit }); const autotoolsStatus = status.data.statuses.find(s => s.context === 'autotools'); if (!autotoolsStatus || autotoolsStatus.state !== 'success') { core.setFailed('Autotools build did not complete successfully'); } - name: Install dependencies on Ubuntu run: | sudo apt-get update sudo apt-get install -y autoconf automake autopoint doxygen g++ gettext git libtool make texinfo texlive texlive-font-utils zsh - name: Check release metadata run: scripts/release/check.zsh --release ${{ github.event.release.tag_name }} - name: Run autogen run: ./autogen.sh - name: Configure run: | export CC=gcc CXX=g++ ./configure - name: Build and Test run: make -j distcheck - name: Check distribution tarball run: scripts/release/check.zsh --release --require-dist ${{ github.event.release.tag_name }} - name: Upload Release Asset env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} run: | gh release upload "${TAG_NAME}" \ "./fswatch-${TAG_NAME}.tar.gz#fswatch-${TAG_NAME}.tar.gz" \ --repo "${GITHUB_REPOSITORY}" \ --clobber - name: Build static Linux x86_64 convenience binary env: TAG_NAME: ${{ github.event.release.tag_name }} run: | docker run --rm \ -e JOBS="$(nproc)" \ -e TAG_NAME="${TAG_NAME}" \ -v "${PWD}:/work" \ -w /work \ alpine:latest \ sh -euxc ' apk add --no-cache autoconf automake binutils build-base file gettext-dev git libtool make tar texinfo zsh git config --global --add safe.directory /work zsh ./scripts/release/build-static-linux-x86_64.zsh "${TAG_NAME}" ' - name: Upload static Linux x86_64 convenience binary env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} run: | gh release upload "${TAG_NAME}" \ "./fswatch-${TAG_NAME}-linux-x86_64-static.tar.gz#fswatch-${TAG_NAME}-linux-x86_64-static.tar.gz" \ --repo "${GITHUB_REPOSITORY}" \ --clobber - name: Build PDF documentation run: make -j pdf - name: Upload Release PDF documentation env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} run: | cp ./fswatch/doc/fswatch.pdf "./fswatch-${TAG_NAME}.pdf" gh release upload "${TAG_NAME}" \ "./fswatch-${TAG_NAME}.pdf" \ --repo "${GITHUB_REPOSITORY}" \ --clobber - name: Build libfswatch Doxygen HTML documentation run: make -C libfswatch/doc/doxygen doc-html-doxygen - name: Upload Release libfswatch Doxygen HTML documentation env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG_NAME: ${{ github.event.release.tag_name }} run: | test -f ./libfswatch/doc/doxygen/html/index.html DOCS_STAGING="${RUNNER_TEMP}/libfswatch-doxygen-release" rm -rf "${DOCS_STAGING}" mkdir -p "${DOCS_STAGING}/doc/libfswatch/${TAG_NAME}" cp -R ./libfswatch/doc/doxygen/html/. "${DOCS_STAGING}/doc/libfswatch/${TAG_NAME}/" tar -C "${DOCS_STAGING}" -czf "./fswatch-${TAG_NAME}-libfswatch-doxygen-html.tar.gz" "doc/libfswatch/${TAG_NAME}" gh release upload "${TAG_NAME}" \ "./fswatch-${TAG_NAME}-libfswatch-doxygen-html.tar.gz" \ --repo "${GITHUB_REPOSITORY}" \ --clobber