-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The UI stopped getting build by the CI. Updated the workflow files to build the UI and upload it as an artifact that people can use. * Improved version command to contain additional version information about the binary. * Imported the workflow to reduce amount of duplicated work * include branch name as part of version information. * moved redundant task to local actions to improve reuse of workflow code fixes #855
- Loading branch information
Showing
19 changed files
with
16,793 additions
and
207 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
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,53 @@ | ||
name: 'setup base env' | ||
description: "setup base environment for build tegola" | ||
inputs: | ||
ui: | ||
description: 'Download UI' | ||
required: false | ||
default: 'false' | ||
go: | ||
description: 'Download install go' | ||
required: false | ||
default: 'true' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Download version artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: version | ||
|
||
- name: Download ui artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ui | ||
path: ${{ github.workspace }}/ui/dist | ||
if: ${{ inputs.ui == 'true' }} | ||
|
||
- name: Set up Go 1.18 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
if: ${{ inputs.go == 'true' }} | ||
|
||
- name: Set tegola version | ||
run: go run ci/cat_version_envs.go -version_file version/version.txt | tee $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Download default-branch-ref artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: default-branch-ref | ||
|
||
- name: Set tegola default branch ref | ||
run: echo "DEFAULT_BRANCH_REF=$(cat default-branch-ref/default-branch-ref.txt)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Say goodbye | ||
run: echo "goodbye! ${{ runner.os }} ${{ runner.arch }}" | ||
shell: bash | ||
|
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,27 @@ | ||
name: tegola-upload-path | ||
description: "returns the correct upload path for os" | ||
inputs: | ||
name: | ||
description: "base dir name" | ||
default: "tegola" | ||
required: false | ||
|
||
outputs: | ||
dir-path: | ||
description: "dir path for tegola" | ||
value: ${{ steps.compute-path.outputs.dir-path }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: set env (not Windows) | ||
run: echo "TEGOLA_PATH=cmd/${{inputs.name}}/" >> $GITHUB_ENV | ||
shell: bash | ||
if: ${{ runner.os != 'Windows' }} | ||
- name: set env (Windows) | ||
run: echo "TEGOLA_PATH=cmd\\${{inputs.name}}\\" >> $GITHUB_ENV | ||
shell: bash | ||
if: ${{ runner.os == 'Windows' }} | ||
- id: compute-path | ||
run: echo "::set-output name=dir-path::${TEGOLA_PATH}" | ||
shell: bash |
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,55 @@ | ||
name: upload artifact | ||
description: "upload generated artifacts including release" | ||
inputs: | ||
artifact_name: | ||
description: "name of the artifact" | ||
default: "tegola" | ||
required: false | ||
upload_postfix: | ||
description: "uploaded name of the artifact" | ||
default: "linux_amd64" | ||
required: false | ||
github_token: | ||
description: "github token" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- id: zip-path | ||
uses: ./.github/actions/tegola_upload_path | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
|
||
# workaround for archives losing permissions | ||
# https://github.com/actions/upload-artifact/issues/38 | ||
- name: Zip (not windows) | ||
run: | | ||
cd ${{steps.zip-path.outputs.dir-path}} | ||
zip -9 -D tegola.zip ${{inputs.artifact_name}} | ||
shell: bash | ||
if: ${{ runner.os != 'Windows' }} | ||
|
||
- name: Zip (windows) | ||
run: | | ||
cd ${{steps.zip-path.outputs.dir-path}} | ||
7z a tegola.zip ${{inputs.artifact_name}}.exe | ||
shell: pwsh | ||
if: ${{ runner.os == 'Windows' }} | ||
|
||
- name: Upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{inputs.artifact_name}}${{inputs.upload_postfix}} | ||
path: ${{steps.zip-path.outputs.dir-path}}tegola.zip | ||
|
||
- name: Upload release asset | ||
if: github.event_name == 'release' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ inputs.github_token }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{steps.zip-path.outputs.dir-path}}tegola.zip | ||
asset_name: ${{inputs.artifact_name}}${{inputs.upload_postfix}}.zip | ||
asset_content_type: application/zip |
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
Oops, something went wrong.