v0.2.8 #655
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DO NOT EDIT - GENERATED FROM .github/workflows/release.ys | |
| name: release | |
| defaults: | |
| run: | |
| shell: bash -e -x {0} | |
| 'on': | |
| workflow_dispatch: null | |
| push: | |
| tags: | |
| - v0.* | |
| - v1.* | |
| - v2.* | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| PROJ_PKG_NAME: c4core- | |
| PROJ_PFX_TARGET: c4core- | |
| PROJ_PFX_CMAKE: C4CORE_ | |
| CMAKE_FLAGS: null | |
| NUM_JOBS_BUILD: null | |
| jobs: | |
| gettag: | |
| if: always() | |
| continue-on-error: false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout (action) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Variables (from tag) | |
| if: contains(github.ref, 'tags/v') | |
| run: | | |
| set -exo pipefail | |
| # https://github.community/t/how-to-get-just-the-tag-name/16241/11 | |
| SRC_TAG=${GITHUB_REF#refs/tags/} | |
| SRC_VERSION=${GITHUB_REF#refs/tags/v} | |
| SRC_VERSION_BODY=`pwd`/changelog/$SRC_VERSION.md | |
| if [ ! -f $SRC_VERSION_BODY ] ; then | |
| echo "version body file was not found: $SRC_VERSION_BODY" | |
| exit 1 | |
| fi | |
| cat <<EOF >> vars.sh | |
| export SRC_TAG=$SRC_TAG | |
| export SRC_VERSION=$SRC_VERSION | |
| export SRC_VERSION_BODY=$SRC_VERSION_BODY | |
| EOF | |
| - name: Variables (from commit, no tag) | |
| if: ${{ !contains(github.ref, 'tags/v') }} | |
| run: | | |
| set -exo pipefail | |
| branch_name=${GITHUB_REF#refs/heads/} | |
| # builds triggered from PRs have the branch_name like this: refs/pull/150/merge | |
| # so filter to eg pr0150_merge | |
| branch_name=`echo $branch_name | sed "s:refs/pull/\([0-9]*\)/\(.*\):pr0\1_\2:"` | |
| # sanitize the branch name; eg merge/foo-bar -> merge_foo_bar | |
| branch_name=`echo $branch_name | sed 's:[/.-]:_:g'` | |
| SRC_TAG=$(git describe || git rev-parse --short HEAD) # eg v0.2.0-110-gda837e0 | |
| SRC_VERSION="${branch_name}-${SRC_TAG}" | |
| cat <<EOF > vars.sh | |
| export SRC_TAG=$SRC_TAG | |
| export SRC_VERSION=$SRC_VERSION | |
| EOF | |
| - name: Save vars.sh | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vars.sh | |
| path: ./vars.sh | |
| - name: Show vars.sh | |
| run: cat vars.sh | |
| - name: Source vars.sh | |
| run: source vars.sh | |
| - name: Env (common) | |
| run: | | |
| source vars.sh | |
| echo "SRC_TAG=$SRC_TAG" >> $GITHUB_ENV | |
| echo "SRC_VERSION=$SRC_VERSION" >> $GITHUB_ENV | |
| - name: Env (from tag) | |
| if: contains(github.ref, 'tags/v') | |
| run: | | |
| source vars.sh | |
| echo "SRC_VERSION_BODY=$SRC_VERSION_BODY" >> $GITHUB_ENV | |
| - name: Variables (from commit, no tag) | |
| if: ${{ !contains(github.ref, 'tags/v') }} | |
| run: echo 'nothing to do' | |
| - name: Verify vars.sh | |
| run: env | grep SRC | |
| src: | |
| if: always() | |
| continue-on-error: false | |
| needs: gettag | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout (action) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Download vars.sh | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: vars.sh | |
| path: ./ | |
| - name: Show vars.sh | |
| run: cat vars.sh | |
| - name: Source vars.sh | |
| run: source vars.sh | |
| - name: Env (common) | |
| run: | | |
| source vars.sh | |
| echo "SRC_TAG=$SRC_TAG" >> $GITHUB_ENV | |
| echo "SRC_VERSION=$SRC_VERSION" >> $GITHUB_ENV | |
| - name: Env (from tag) | |
| if: contains(github.ref, 'tags/v') | |
| run: | | |
| source vars.sh | |
| echo "SRC_VERSION_BODY=$SRC_VERSION_BODY" >> $GITHUB_ENV | |
| - name: Variables (from commit, no tag) | |
| if: ${{ !contains(github.ref, 'tags/v') }} | |
| run: echo 'nothing to do' | |
| - name: Verify vars.sh | |
| run: env | grep SRC | |
| - name: Install python 3.9 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.9 | |
| - name: Install requirements | |
| run: | | |
| sudo -E pip install git-archive-all | |
| - name: Create source packages | |
| run: | | |
| pwd | |
| ls -lFhp | |
| source vars.sh | |
| echo SRC_TAG=$SRC_TAG | |
| echo SRC_VERSION=$SRC_VERSION | |
| id=${PROJ_PKG_NAME}${SRC_VERSION} | |
| name=${id}-src | |
| mkdir -p assets | |
| git-archive-all --prefix $name assets/$name.tgz | |
| git-archive-all --prefix $name assets/$name.zip | |
| python --version | |
| python tools/amalgamate.py assets/$id.hpp | |
| - name: Save source artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: assets-src | |
| path: assets | |
| cpp: | |
| name: cpp/${{matrix.os}}/${{matrix.gen}} | |
| needs: gettag | |
| runs-on: ${{matrix.os}} | |
| env: | |
| DEV: 'OFF' | |
| BT: Release | |
| OS: ${{matrix.os}} | |
| CXX_: ${{matrix.cxx}} | |
| GEN: ${{matrix.gen}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Ubuntu 24.04 deb | |
| sfxg: unix64-shared-Release.deb | |
| sfxp: ubuntu-24.04.deb | |
| gen: DEB | |
| mime: vnd.debian.binary-package | |
| os: ubuntu-24.04 | |
| - name: Ubuntu 22.04 deb | |
| sfxg: unix64-shared-Release.deb | |
| sfxp: ubuntu-22.04.deb | |
| gen: DEB | |
| mime: vnd.debian.binary-package | |
| os: ubuntu-22.04 | |
| - name: Windows VS2022 zip | |
| sfxg: win64-shared-Release.zip | |
| sfxp: windows-vs2022.zip | |
| gen: ZIP | |
| mime: zip | |
| os: windows-2022 | |
| cxx: vs2022 | |
| - name: MacOSX sh | |
| sfxg: apple64-shared-Release.sh | |
| sfxp: macosx-xcode.sh | |
| gen: STGZ | |
| mime: x-sh | |
| os: macos-15-intel | |
| cxx: xcode | |
| steps: | |
| - name: checkout (action) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Download vars.sh | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: vars.sh | |
| path: ./ | |
| - name: Show vars.sh | |
| run: cat vars.sh | |
| - name: Source vars.sh | |
| run: source vars.sh | |
| - name: Env (common) | |
| run: | | |
| source vars.sh | |
| echo "SRC_TAG=$SRC_TAG" >> $GITHUB_ENV | |
| echo "SRC_VERSION=$SRC_VERSION" >> $GITHUB_ENV | |
| - name: Env (from tag) | |
| if: contains(github.ref, 'tags/v') | |
| run: | | |
| source vars.sh | |
| echo "SRC_VERSION_BODY=$SRC_VERSION_BODY" >> $GITHUB_ENV | |
| - name: Variables (from commit, no tag) | |
| if: ${{ !contains(github.ref, 'tags/v') }} | |
| run: echo 'nothing to do' | |
| - name: Verify vars.sh | |
| run: env | grep SRC | |
| - name: install requirements | |
| run: source .github/reqs.sh && c4_install_test_requirements $OS | |
| - name: show info | |
| run: source .github/setenv.sh && c4_show_info | |
| - name: shared64-configure--------------------------------------------------- | |
| run: source .github/setenv.sh && c4_cfg_test shared64 | |
| - name: shared64-build | |
| run: source .github/setenv.sh && c4_build_target shared64 | |
| - name: shared64-pack | |
| run: source .github/setenv.sh && c4_package shared64 $GEN | |
| - name: shared64-normalize | |
| run: | | |
| set -x | |
| source vars.sh | |
| ls -lFhp . | |
| ls -lFhp ./build | |
| ls -lFhp ./build/shared64 | |
| mkdir -p assets | |
| asset_src=`ls -1 ./build/shared64/${PROJ_PFX_TARGET}*-${{matrix.sfxg}}` | |
| asset_dst=./assets/${PROJ_PKG_NAME}${SRC_VERSION}-${{matrix.sfxp}} | |
| [ ! -f $asset_src ] && exit 1 | |
| cp -fav $asset_src $asset_dst | |
| - name: Save artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: assets-cpp-${{matrix.os}}-${{matrix.cxx}} | |
| path: assets | |
| merge_artifacts: | |
| if: always() | |
| continue-on-error: false | |
| runs-on: ubuntu-latest | |
| needs: | |
| - src | |
| - cpp | |
| steps: | |
| - name: Merge assets artifacts | |
| uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: assets | |
| pattern: assets-* | |
| separate-directories: true | |
| delete-merged: true | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - merge_artifacts | |
| steps: | |
| - name: checkout (action) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Gather artifacts - ./assets | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: assets | |
| pattern: assets | |
| - name: Verify existing artifacts | |
| run: | | |
| ls -lFhp . | |
| ls -lFhp assets*/ || echo 'none found' | |
| ( \ | |
| mkdir -p assets | |
| cd assets ; \ | |
| for asset in ../assets-*/ ; do \ | |
| ls -lFhpA $asset/ ; \ | |
| mv -v $asset/* . ; \ | |
| rmdir $asset ; \ | |
| done ; | |
| ) | |
| ls -lFhp assets*/ || echo 'none found' | |
| - name: Download vars.sh | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: vars.sh | |
| path: ./ | |
| - name: Show vars.sh | |
| run: cat vars.sh | |
| - name: Source vars.sh | |
| run: source vars.sh | |
| - name: Env (common) | |
| run: | | |
| source vars.sh | |
| echo "SRC_TAG=$SRC_TAG" >> $GITHUB_ENV | |
| echo "SRC_VERSION=$SRC_VERSION" >> $GITHUB_ENV | |
| - name: Env (from tag) | |
| if: contains(github.ref, 'tags/v') | |
| run: | | |
| source vars.sh | |
| echo "SRC_VERSION_BODY=$SRC_VERSION_BODY" >> $GITHUB_ENV | |
| - name: Variables (from commit, no tag) | |
| if: ${{ !contains(github.ref, 'tags/v') }} | |
| run: echo 'nothing to do' | |
| - name: Verify vars.sh | |
| run: env | grep SRC | |
| - name: Create Github Release | |
| if: contains(github.ref, 'tags/v') | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| with: | |
| tag_name: ${{github.ref}} | |
| release_name: Release ${{env.SRC_VERSION}} | |
| body_path: ${{env.SRC_VERSION_BODY}} | |
| draft: true | |
| prerelease: ${{contains(github.ref, 'rc')}} | |
| - name: Upload assets to Github Release | |
| if: contains(github.ref, 'tags/v') | |
| uses: dwenegar/upload-release-assets@v1 | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| with: | |
| release_id: ${{steps.create_release.outputs.id}} | |
| assets_path: ./assets/ |