Release #7
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
| name: Release | |
| on: | |
| workflow_dispatch: # Run on manual trigger | |
| jobs: | |
| semantic-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # to be able to publish a GitHub release | |
| issues: write # to be able to comment on released issues | |
| pull-requests: write # to be able to comment on released pull requests | |
| id-token: write # to enable use of OIDC for npm provenance | |
| outputs: | |
| new_release_git_tag: ${{ steps.semantic.outputs.new_release_git_tag }} | |
| new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
| new_release_notes: ${{ steps.semantic.outputs.new_release_notes }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Semantic Release | |
| uses: cycjimmy/semantic-release-action@v4 | |
| id: semantic | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-ubuntu: | |
| runs-on: ubuntu-latest | |
| needs: semantic-release | |
| strategy: | |
| matrix: | |
| build: [ regex, pcre2 ] | |
| outputs: | |
| new_release_git_tag: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.semantic-release.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.semantic-release.outputs.new_release_notes }} | |
| env: | |
| RELEASE_VERSION: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: sudo apt -y install gcc apache2-dev libmaxminddb-dev libpcre2-dev | |
| - if: ${{ matrix.build == 'regex' }} | |
| name: Build module | |
| run: apxs -c -lmaxminddb mod_repudiator.c | |
| - if: ${{ matrix.build == 'pcre2' }} | |
| name: Build module | |
| run: apxs -c -DPCRE2 -lmaxminddb -lpcre2-8 mod_repudiator.c | |
| - name: Update generated-files cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .libs/mod_repudiator.so | |
| key: generated-files-${{ github.run_id }}-ubuntu-${{ matrix.build }} | |
| restore-keys: generated-files | |
| build-rocky: | |
| runs-on: ubuntu-latest | |
| needs: semantic-release | |
| strategy: | |
| matrix: | |
| version: [ 8, 9 ] | |
| build: [ regex, pcre2 ] | |
| container: | |
| image: rockylinux/rockylinux:${{ matrix.version }} | |
| outputs: | |
| new_release_git_tag: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.semantic-release.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.semantic-release.outputs.new_release_notes }} | |
| env: | |
| RELEASE_VERSION: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install EPEL | |
| run: dnf -y install epel-release | |
| - name: Enable CRB | |
| run: crb enable | |
| - name: Install dependencies | |
| run: dnf -y install gcc httpd-devel libmaxminddb-devel pcre2-devel redhat-rpm-config | |
| - if: ${{ matrix.build == 'regex' }} | |
| name: Build module | |
| run: apxs -c -lmaxminddb mod_repudiator.c | |
| - if: ${{ matrix.build == 'pcre2' }} | |
| name: Build module | |
| run: apxs -c -DPCRE2 -lmaxminddb -lpcre2-8 mod_repudiator.c | |
| - name: Update generated-files cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .libs/mod_repudiator.so | |
| key: generated-files-${{ github.run_id }}-rl${{ matrix.version }}-${{ matrix.build }} | |
| restore-keys: generated-files | |
| ######################################################################################### | |
| ## Build RPMs | |
| ######################################################################################### | |
| rpm-rocky: | |
| runs-on: ubuntu-latest | |
| needs: semantic-release | |
| strategy: | |
| matrix: | |
| version: [ 8, 9 ] | |
| outputs: | |
| new_release_git_tag: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.semantic-release.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.semantic-release.outputs.new_release_notes }} | |
| env: | |
| RELEASE_VERSION: ${{ needs.semantic-release.outputs.new_release_git_tag }} | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: mod_repudiator | |
| fetch-depth: 0 | |
| - name: Build Mock Environment | |
| uses: docker/build-push-action@v6 | |
| with: | |
| tags: mock:latest | |
| file: mod_repudiator/.github/workflows/Dockerfile | |
| context: . | |
| pull: true | |
| push: false | |
| load: true | |
| - name: Set Variables | |
| id: vars | |
| run: | | |
| pushd . | |
| cd mod_repudiator | |
| echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "branch=$(echo ${{ github.ref_name }} | tr / __)" >> $GITHUB_OUTPUT | |
| popd | |
| - name: Build RPM | |
| run: | | |
| sed -i "s/0.0.0/${{ needs.semantic-release.outputs.new_release_version }}/g" mod_repudiator/mod_repudiator.spec | |
| cat mod_repudiator/mod_repudiator.spec | |
| mkdir mock | |
| docker run --privileged --cap-add=SYS_ADMIN -t --rm -v $PWD/mod_repudiator:/root/mod_repudiator -v $PWD/mock:/var/lib/mock mock:latest sh -c "mock -r rocky+epel-${{ matrix.version }}-x86_64 --spec /root/mod_repudiator/mod_repudiator.spec --sources /root/mod_repudiator" | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-rpms-${{ github.run_id }}-rl${{ matrix.version }} | |
| restore-keys: package | |
| - name: Prepare package*.zip artifact | |
| run: | | |
| rm -rf package | |
| mkdir -p package | |
| rm -rf package/*.zip | |
| cp -f mock/rocky+epel-${{ matrix.version }}-x86_64/result/mod_repudiator*.rpm package/ | |
| cd ./package | |
| - name: Upload RPM | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mod_repudiator-rpms-rl${{ matrix.version }}-x86_64 | |
| path: ./package | |
| ######################################################################################### | |
| ## Build Package | |
| ######################################################################################### | |
| package-ubuntu: | |
| runs-on: ubuntu-latest | |
| needs: build-ubuntu | |
| strategy: | |
| matrix: | |
| build: [ regex, pcre2 ] | |
| outputs: | |
| new_release_git_tag: ${{ needs.build-ubuntu.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.build-ubuntu.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.build-ubuntu.outputs.new_release_notes }} | |
| env: | |
| RELEASE_VERSION: ${{ needs.build-ubuntu.outputs.new_release_git_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update generated-files cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .libs/mod_repudiator.so | |
| key: generated-files-${{ github.run_id }}-ubuntu-${{ matrix.build }} | |
| restore-keys: generated-files | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-${{ github.run_id }}-ubuntu-${{ matrix.build }} | |
| restore-keys: package | |
| - name: Set Variables | |
| id: vars | |
| run: | | |
| echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "branch=$(echo ${{ github.ref_name }} | tr / __)" >> $GITHUB_OUTPUT | |
| - name: Prepare package*.zip artifact | |
| run: | | |
| rm -rf package | |
| mkdir -p package | |
| rm -rf package/*.zip | |
| cp -f ".libs/mod_repudiator.so" "package/mod_repudiator.so" | |
| cp -f "mod_repudiator.conf" "package/mod_repudiator.conf" | |
| cd ./package | |
| - name: Upload package.zip artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "mod_repudiator-ubuntu-${{ matrix.build }}-${{ steps.vars.outputs.branch }}_(${{ steps.vars.outputs.sha_short }})" | |
| path: ./package | |
| package-rocky: | |
| runs-on: ubuntu-latest | |
| needs: build-rocky | |
| strategy: | |
| matrix: | |
| version: [ 8, 9 ] | |
| build: [ regex, pcre2 ] | |
| outputs: | |
| new_release_git_tag: ${{ needs.build-rocky.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.build-rocky.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.build-rocky.outputs.new_release_notes }} | |
| env: | |
| RELEASE_VERSION: ${{ needs.build-rocky.outputs.new_release_git_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update generated-files cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .libs/mod_repudiator.so | |
| key: generated-files-${{ github.run_id }}-rl${{ matrix.version }}-${{ matrix.build }} | |
| restore-keys: generated-files | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-${{ github.run_id }}-rl${{ matrix.version }}-${{ matrix.build }} | |
| restore-keys: package | |
| - name: Set Variables | |
| id: vars | |
| run: | | |
| echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "branch=$(echo ${{ github.ref_name }} | tr / __)" >> $GITHUB_OUTPUT | |
| - name: Prepare package*.zip artifact | |
| run: | | |
| rm -rf package | |
| mkdir -p package | |
| rm -rf package/*.zip | |
| cp -f ".libs/mod_repudiator.so" "package/mod_repudiator.so" | |
| cp -f "mod_repudiator.conf" "package/mod_repudiator.conf" | |
| cd ./package | |
| - name: Upload package.zip artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "mod_repudiator-rl${{ matrix.version }}-${{ matrix.build }}-${{ steps.vars.outputs.branch }}_(${{ steps.vars.outputs.sha_short }})" | |
| path: ./package | |
| ######################################################################################### | |
| ## Prepare and create release artifacts | |
| ######################################################################################### | |
| release-artifacts-ubuntu: | |
| runs-on: ubuntu-latest | |
| needs: package-ubuntu | |
| strategy: | |
| matrix: | |
| build: [ regex, pcre2 ] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| outputs: | |
| new_release_git_tag: ${{ needs.package-ubuntu.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.package-ubuntu.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.package-ubuntu.outputs.new_release_notes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-${{ github.run_id }}-ubuntu-${{ matrix.build }} | |
| restore-keys: package | |
| - name: Prepare artifacts for release | |
| run: | | |
| rm -rf release | |
| mkdir -p release | |
| ls -la . | |
| cd ./package | |
| zip -r ../release/mod_repudiator-ubuntu-${{ matrix.build }}-${{ needs.package-ubuntu.outputs.new_release_git_tag }}.zip . | |
| - name: Release artifacts | |
| uses: softprops/action-gh-release@v2.0.8 | |
| with: | |
| tag_name: ${{ needs.package-ubuntu.outputs.new_release_git_tag }} | |
| name: ${{ needs.package-ubuntu.outputs.new_release_version }} | |
| body: ${{ needs.package-ubuntu.outputs.new_release_notes }} | |
| files: | | |
| release/* | |
| release-artifacts-rocky: | |
| runs-on: ubuntu-latest | |
| needs: package-rocky | |
| strategy: | |
| matrix: | |
| version: [ 8, 9 ] | |
| build: [ regex, pcre2 ] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| outputs: | |
| new_release_git_tag: ${{ needs.package-rocky.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.package-rocky.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.package-rocky.outputs.new_release_notes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-${{ github.run_id }}-rl${{ matrix.version }}-${{ matrix.build }} | |
| restore-keys: package | |
| - name: Prepare artifacts for release | |
| run: | | |
| rm -rf release | |
| mkdir -p release | |
| ls -la . | |
| cd ./package | |
| zip -r ../release/mod_repudiator-rl${{ matrix.version }}-${{ matrix.build }}-${{ needs.package-rocky.outputs.new_release_git_tag }}.zip . | |
| - name: Release artifacts | |
| uses: softprops/action-gh-release@v2.0.8 | |
| with: | |
| tag_name: ${{ needs.package-rocky.outputs.new_release_git_tag }} | |
| name: ${{ needs.package-rocky.outputs.new_release_version }} | |
| body: ${{ needs.package-rocky.outputs.new_release_notes }} | |
| files: | | |
| release/* | |
| release-artifacts-rocky-rpm: | |
| runs-on: ubuntu-latest | |
| needs: rpm-rocky | |
| strategy: | |
| matrix: | |
| version: [ 8, 9 ] | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| outputs: | |
| new_release_git_tag: ${{ needs.rpm-rocky.outputs.new_release_git_tag }} | |
| new_release_version: ${{ needs.rpm-rocky.outputs.new_release_version }} | |
| new_release_notes: ${{ needs.rpm-rocky.outputs.new_release_notes }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update package cache on every commit | |
| uses: actions/cache@v4 | |
| with: | |
| path: package | |
| key: package-rpms-${{ github.run_id }}-rl${{ matrix.version }} | |
| restore-keys: package | |
| - name: Release artifacts | |
| uses: softprops/action-gh-release@v2.0.8 | |
| with: | |
| tag_name: ${{ needs.rpm-rocky.outputs.new_release_git_tag }} | |
| name: ${{ needs.rpm-rocky.outputs.new_release_version }} | |
| body: ${{ needs.rpm-rocky.outputs.new_release_notes }} | |
| files: | | |
| package/* |