## Github workflow to create a github release and upload binary artifacts name: Github Release on: workflow_call: inputs: tag: description: "Release Tag" required: true type: string secrets: GH_TOKEN: required: true concurrency: group: github-release-${{ github.head_ref || github.ref }} ## Always cancel duplicate jobs cancel-in-progress: true run-name: ${{ inputs.tag }} jobs: ## Build arch dependent binaries from source ## ## Runs when the following is true: ## - tag is provided ## - workflow is building default branch (master) build-binaries: if: | inputs.tag != '' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) name: Build Binaries uses: ./.github/workflows/create-source-binary.yml with: tag: ${{ inputs.tag }} secrets: inherit ## Build x86_64 binaries from source ## ## Runs when the following is true: ## - tag is provided ## - workflow is building default branch (master) build-binaries-x64: if: | inputs.tag != '' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) name: Build Binaries (x64_64) uses: ./.github/workflows/create-source-binary-x64.yml with: tag: ${{ inputs.tag }} secrets: inherit ## Runs when the following is true: ## - tag is provided ## - workflow is building default branch (master) create-release: if: | inputs.tag != '' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) name: Create Release runs-on: ubuntu-latest needs: - build-binaries - build-binaries-x64 steps: ## Downloads the artifacts built in `create-source-binary.yml` - name: Download Artifacts id: download_artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: artifact path: release ## Generate a checksums file to be added to the release page - name: Generate Checksums id: generate_checksum uses: jmgilman/actions-generate-checksum@24a35957fba81c6cbaefeb1e3d59ee56e3db5077 # v1.0.0 with: method: sha512 output: CHECKSUMS.txt patterns: | release/*.zip ## Upload the release archives with the checksums file - name: Upload Release id: upload_release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 #v0.1.15 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} with: name: Release ${{ github.event.inputs.tag || github.ref }} tag_name: ${{ github.event.inputs.tag || github.ref }} draft: false prerelease: true fail_on_unmatched_files: true files: | release/*.zip CHECKSUMS.txt ## Builds arch dependent Docker images from binaries ## ## Runs when the following is true: ## - tag is provided ## - workflow is building default branch (master) docker-image: if: | inputs.tag != '' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) name: Docker Image (Binary) uses: ./.github/workflows/image-build-binary.yml needs: - build-binaries - build-binaries-x64 - create-release with: tag: ${{ inputs.tag }} secrets: inherit