mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 04:04:03 -05:00
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 3.0.3 to 3.0.4. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/efb35369e0ad2afab669f228072c1b0d510eae64...8a0cd651e5b2365bd640854a3fa5dfc70e4875f3) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: 3.0.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
85 lines
3.1 KiB
YAML
85 lines
3.1 KiB
YAML
name: release-source-tarball
|
|
|
|
# GitHub's auto-generated "Source code" release assets are plain `git archive`
|
|
# output and do not contain submodules, so they cannot be built (see #3781,
|
|
# #4725). This workflow attaches a complete source tarball, submodules
|
|
# included, to every release. It can also be dispatched manually to backfill
|
|
# the asset onto an existing release tag.
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Existing release tag to build and attach the tarball to'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
tarball:
|
|
name: Build full source tarball
|
|
if: github.repository == 'ZoneMinder/zoneminder' || github.event_name == 'workflow_dispatch'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Determine release tag
|
|
id: tag
|
|
# Expressions go through env: so the shell sees them as data; inline
|
|
# ${{ }} in run: is pasted into the script before the shell parses it.
|
|
env:
|
|
DISPATCH_TAG: ${{ inputs.tag }}
|
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
run: |
|
|
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
|
|
echo "tag=${DISPATCH_TAG}" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "tag=${RELEASE_TAG}" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
with:
|
|
ref: ${{ steps.tag.outputs.tag }}
|
|
submodules: recursive
|
|
|
|
- name: Create tarball
|
|
id: tarball
|
|
env:
|
|
TAG: ${{ steps.tag.outputs.tag }}
|
|
run: |
|
|
set -eux
|
|
TARBALL="zoneminder-${TAG}.tar.gz"
|
|
# Reproducible: fixed mtime from the tagged commit, sorted entries,
|
|
# no owner info, no gzip timestamp. Re-running the workflow for the
|
|
# same tag produces byte-identical output.
|
|
COMMIT_TS="$(git log -1 --format=%ct)"
|
|
tar --exclude-vcs \
|
|
--sort=name \
|
|
--mtime="@${COMMIT_TS}" \
|
|
--owner=0 --group=0 --numeric-owner \
|
|
--transform "s,^\.,zoneminder-${TAG}," \
|
|
-cf - . | gzip -n > "../${TARBALL}"
|
|
mv "../${TARBALL}" .
|
|
sha256sum "${TARBALL}" > "${TARBALL}.sha256"
|
|
echo "tarball=${TARBALL}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Sanity check submodules are populated
|
|
env:
|
|
TARBALL: ${{ steps.tarball.outputs.tarball }}
|
|
run: |
|
|
set -eux
|
|
# The same file CMakeLists.txt checks before allowing a build
|
|
tar -tzf "${TARBALL}" | grep -q 'web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php'
|
|
tar -tzf "${TARBALL}" | grep -q 'dep/RtspServer/CMakeLists.txt'
|
|
tar -tzf "${TARBALL}" | grep -q 'dep/CxxUrl/CMakeLists.txt'
|
|
|
|
- name: Attach to release
|
|
uses: softprops/action-gh-release@8a0cd651e5b2365bd640854a3fa5dfc70e4875f3 # v3
|
|
with:
|
|
tag_name: ${{ steps.tag.outputs.tag }}
|
|
files: |
|
|
${{ steps.tarball.outputs.tarball }}
|
|
${{ steps.tarball.outputs.tarball }}.sha256
|