Skip to content

trigger_deploy_release_event #11

trigger_deploy_release_event

trigger_deploy_release_event #11

# run CMake build on Windows and Linux
name: Create Release
on:
#push:
# branches: [ "release" ]
repository_dispatch:
types: [ "trigger_deploy_release_event" ]
permissions:
contents: read
env:
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
ARTIFACTS_DIR_WIN: ${{ github.workspace }}\artifacts
jobs:
release:
# only on pushes to the release branch
name: Create Release
#needs: build
#if: ${{ (github.ref_name == 'release') && github.event_name == 'push' }}
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Check Dispatch ID
run: |
if [[ "${{ github.event.client_payload.dispatch_id }}" == "${{ secrets.DISPATCH_ID }}" ]]; then
echo "Dispatch ID is correct"
else
echo "Dispatch ID is not correct"
exit 1
fi
- name: Checkout Repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download Artifacts
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4
with:
workflow: cmake-multi-platform.yml
workflow_conclusion: success
path: ${{ github.workspace }}/artifacts
- name: Rename Artifacts
run: |
mv ${{ github.workspace }}/artifacts/ubuntu-22.04-artifacts/artifacts-ubuntu-22.04.zip ${{ github.workspace }}/artifacts/OdbDesign-Linux-x64.zip
mv ${{ github.workspace }}/artifacts/windows-2022-artifacts/artifacts-windows-2022.zip ${{ github.workspace }}/artifacts/OdbDesign-Windows-x64.zip
mv ${{ github.workspace }}/artifacts/macos-12-artifacts/artifacts-macos-12.zip ${{ github.workspace }}/artifacts/OdbDesign-MacOS-x64.zip
- name: Generate SHA256 Sums
run: |
# sha256
cd ${{ github.workspace }}/artifacts
sha256sum OdbDesign-Linux-x64.zip > OdbDesign-Linux-x64.zip.sha256sum
sha256sum OdbDesign-Windows-x64.zip > OdbDesign-Windows-x64.zip.sha256sum
sha256sum OdbDesign-MacOS-x64.zip > OdbDesign-MacOS-x64.zip.sha256sum
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Sign Binaries
run: |
cd ${{ github.workspace }}/artifacts
gpg --batch --yes --detach-sign --armor OdbDesign-Linux-x64.zip
gpg --batch --yes --detach-sign --armor OdbDesign-Windows-x64.zip
gpg --batch --yes --detach-sign --armor OdbDesign-MacOS-x64.zip
- name: Create Release Variables
run: |
export RELEASE_VERSION="${{vars.RELEASE_VERSION_PREFIX}}.${{ github.event.client_payload.run_number }}"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
export RELEASE_TAG="v${RELEASE_VERSION}"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
export RELEASE_NAME="OdbDesign ${RELEASE_TAG}"
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
# create a release
- name: "Create GitHub Release"
uses: "actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea" # v7.0.1
id: create-github-release
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const script = require('./scripts/create-release.js')
script({github, context, core}, '${{ github.workspace }}', '${{ github.ref_name }}')