mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-01-12 22:43:42 +08:00
95 lines
2.5 KiB
YAML
95 lines
2.5 KiB
YAML
## 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
|
|
build-binaries:
|
|
if: |
|
|
inputs.tag != ''
|
|
name: Build Binaries
|
|
uses: ./.github/workflows/create-source-binary.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 != ''
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build-binaries
|
|
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: stacks-network/actions/generate-checksum@main
|
|
|
|
## 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
|
|
target_commitish: ${{ github.sha }}
|
|
generate_release_notes: 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 != ''
|
|
name: Docker Image (Binary)
|
|
uses: ./.github/workflows/image-build-binary.yml
|
|
needs:
|
|
- build-binaries
|
|
- create-release
|
|
with:
|
|
tag: ${{ inputs.tag }}
|
|
secrets: inherit
|