-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-type: patch Signed-off-by: Leandro Motta Barros <leandro@balena.io>
- Loading branch information
Showing
17 changed files
with
380 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
.gopath | ||
bundles | ||
vendor/pkg | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: cleanup | ||
# https://github.com/product-os/flowzone/tree/master/.github/actions | ||
inputs: | ||
json: | ||
description: "JSON stringified object containing all the inputs from the calling workflow" | ||
required: true | ||
secrets: | ||
description: "JSON stringified object containing all the secrets from the calling workflow" | ||
required: true | ||
|
||
# --- custom environment | ||
VERBOSE: | ||
type: string | ||
default: "true" | ||
|
||
runs: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
using: "composite" | ||
steps: | ||
# delete draft releases if the pull request is closed without merging | ||
- name: Delete draft release | ||
if: | | ||
runner.os == 'Linux' && | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.merged == false && | ||
github.event.action == 'closed' | ||
shell: bash | ||
run: | | ||
set -ea | ||
[[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x | ||
gh release delete --yes '${{ github.event.pull_request.head.ref }}' || true | ||
env: | ||
GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: publish GitHub release | ||
# https://github.com/product-os/flowzone/tree/master/.github/actions | ||
inputs: | ||
json: | ||
description: "JSON stringified object containing all the inputs from the calling workflow" | ||
required: true | ||
secrets: | ||
description: "JSON stringified object containing all the secrets from the calling workflow" | ||
required: true | ||
|
||
# --- custom environment | ||
VERBOSE: | ||
type: string | ||
default: "true" | ||
|
||
runs: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
using: "composite" | ||
steps: | ||
# https://docs.github.com/en/rest/releases | ||
- name: Finalize release | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: | | ||
set -ea | ||
[[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x | ||
# prevent git from existing with 141 | ||
set +o pipefail | ||
current_version="v$(yq e '.[0].version' .versionbot/CHANGELOG.yml)" | ||
previous_version="v$(yq e '.[1].version' .versionbot/CHANGELOG.yml)" | ||
release_notes="$(git log ${previous_version}..HEAD --pretty=reference)" | ||
gh release edit '${{ github.event.pull_request.head.ref }}' \ | ||
--notes "${release_notes}" \ | ||
--title "${current_version}" \ | ||
--tag "${current_version}" \ | ||
--prerelease=false \ | ||
--draft=false | ||
release_id="$(gh api "/repos/${{ github.repository }}/releases/tags/${current_version}" \ | ||
-H 'Accept: application/vnd.github+json' | jq -r .id)" | ||
gh api --method PATCH "/repos/${{ github.repository }}/releases/${release_id}" \ | ||
-H 'Accept: application/vnd.github+json' \ | ||
-F make_latest="true" | ||
env: | ||
GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: build and draft GitHub release | ||
# https://github.com/product-os/flowzone/tree/master/.github/actions | ||
inputs: | ||
json: | ||
description: "JSON stringified object containing all the inputs from the calling workflow" | ||
required: true | ||
secrets: | ||
description: "JSON stringified object containing all the secrets from the calling workflow" | ||
required: true | ||
|
||
# --- custom environment | ||
VERBOSE: | ||
type: string | ||
default: "true" | ||
|
||
runs: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
using: "composite" | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# https://github.com/moby/moby/blob/master/.github/workflows | ||
- name: Build release | ||
uses: docker/bake-action@v2 | ||
with: | ||
targets: cross | ||
env: | ||
DOCKER_CROSSPLATFORMS: ${{ env.matrix_value }} | ||
|
||
# https://github.com/product-os/scripts/tree/master/balena-engine | ||
# https://github.com/product-os/ci-images/tree/master/pipelines/balena-engine | ||
# https://github.com/product-os/balena-concourse/blob/master/pipelines/github-events/template.yml | ||
- name: Package release | ||
shell: bash | ||
run: | | ||
set -ea | ||
[[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x | ||
version="v$(yq e '.[0].version' .versionbot/CHANGELOG.yml)" | ||
arch="$(echo '${{ env.matrix_value }}' \ | ||
| sed 's#linux/##g' \ | ||
| sed 's#arm/v#armv#g' \ | ||
| sed 's#v5#v5e#g' \ | ||
| sed 's#v6#v6l#g' \ | ||
| sed 's#v7#v7hf#g')" | ||
mkdir -p dist | ||
tar -czvf dist/balena-engine-${version}-${arch}.tar.gz \ | ||
-C bundles/cross/${{ env.matrix_value }} . | ||
# https://github.com/softprops/action-gh-release#-customizing | ||
- name: Publish release assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# use PR branch name for draft releases | ||
name: ${{ github.event.pull_request.head.ref }} | ||
tag_name: ${{ github.event.pull_request.head.ref }} | ||
draft: true | ||
prerelease: true | ||
token: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} | ||
files: | | ||
dist/*.tar.gz |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: prepare draft release | ||
# https://github.com/product-os/flowzone/tree/master/.github/actions | ||
inputs: | ||
json: | ||
description: "JSON stringified object containing all the inputs from the calling workflow" | ||
required: true | ||
secrets: | ||
description: "JSON stringified object containing all the secrets from the calling workflow" | ||
required: true | ||
|
||
# --- custom environment | ||
VERBOSE: | ||
type: string | ||
default: "true" | ||
|
||
runs: | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
using: "composite" | ||
steps: | ||
- name: Delete previous draft release | ||
shell: bash | ||
run: | | ||
set -ea | ||
[[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x | ||
gh release delete --yes '${{ github.event.pull_request.head.ref }}' || true | ||
env: | ||
GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} | ||
|
||
# https://github.com/softprops/action-gh-release#-customizing | ||
- name: Create release placeholder | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
# use PR branch name for draft releases | ||
name: ${{ github.event.pull_request.head.ref }} | ||
tag_name: ${{ github.event.pull_request.head.ref }} | ||
draft: true | ||
prerelease: true | ||
token: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Flowzone | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, closed] | ||
branches: | ||
- "main" | ||
- "master" | ||
|
||
jobs: | ||
flowzone: | ||
name: Flowzone | ||
uses: product-os/flowzone/.github/workflows/flowzone.yml@master | ||
secrets: inherit | ||
with: | ||
# https://github.com/golang/go/blob/master/src/go/build/syslist.go | ||
custom_publish_matrix: "linux/386,linux/amd64,linux/arm/v5,linux/arm/v6,linux/arm/v7,linux/arm64" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.