-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5145 from rancher/richard-cox-2.7-drone
[2.7] Port drone build tasks to gh workflows + actions
- Loading branch information
Showing
15 changed files
with
169 additions
and
432 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
name: Setup UI Env | ||
description: Setup node, python and call bootstrap script | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14.x' | ||
|
||
- name: Install Python for node-sass | ||
shell: bash | ||
run: | | ||
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends python2 | ||
- name: Install packages | ||
shell: bash | ||
run: ./scripts/bootstrap |
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 Upload | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
CI_BRANCH: | ||
required: false | ||
type: string | ||
CI_BUILD_TAG: | ||
required: false | ||
type: string | ||
|
||
env: | ||
CI_BRANCH: ${{inputs.CI_BRANCH || ''}} | ||
CI_BUILD_TAG: ${{inputs.CI_BUILD_TAG || ''}} | ||
REPO: ${{github.event.repository.name || ''}} | ||
|
||
jobs: | ||
build-and-upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup env | ||
uses: ./.github/actions/setup | ||
|
||
- id: build | ||
name: Build | ||
run: ./scripts/build-static | ||
|
||
- name: Get gcs auth | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH | ||
- name: Apply gcs auth | ||
# https://github.com/google-github-actions/auth | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
credentials_json: "${{ env.GOOGLE_AUTH }}" | ||
|
||
- name: Upload build | ||
uses: 'google-github-actions/upload-cloud-storage@v2' | ||
# https://github.com/google-github-actions/upload-cloud-storage | ||
with: | ||
path: ${{steps.build.outputs.BUILD_DIR}} | ||
# Example - https://releases.rancher.com/ui/2.8.0/... | ||
destination: releases.rancher.com/${{ env.REPO }}/${{ steps.build.outputs.VERSION }} | ||
parent: false | ||
headers: |- | ||
cache-control: no-cache,must-revalidate | ||
process_gcloudignore: false | ||
|
||
- name: Upload tar | ||
if: ${{ env.CI_BUILD_TAG != ''}} | ||
uses: 'google-github-actions/upload-cloud-storage@v2' | ||
with: | ||
path: ${{steps.build.outputs.BUILD_TGZ}} | ||
# Example - https://releases.rancher.com/ui/2.8.0.tar.gz | ||
destination: releases.rancher.com/${{ env.REPO }} | ||
parent: false | ||
headers: |- | ||
cache-control: no-cache,must-revalidate | ||
process_gcloudignore: false |
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: Build (Branch) | ||
on: | ||
push: | ||
branches: | ||
- release-2.7 | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml | ||
build-branch-and-upload: | ||
uses: ./.github/workflows/build-and-upload.yaml | ||
needs: test | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
with: | ||
CI_BRANCH: ${{github.ref_name}} |
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: Build 2.7 (Release) | ||
on: | ||
push: | ||
tags: | ||
- v2.7.* | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml | ||
build-tag-and-upload: | ||
uses: ./.github/workflows/build-and-upload.yaml | ||
needs: test | ||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
with: | ||
CI_BUILD_TAG: ${{github.ref_name}} |
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,36 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- release-2.7 | ||
pull_request: | ||
branches: | ||
- release-2.7 | ||
# This tells GH that the workflow is reusable | ||
workflow_call: | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Run Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run tests | ||
run: yarn test | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Run Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Run linter | ||
run: yarn lint:js |
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 |
---|---|---|
|
@@ -46,5 +46,3 @@ GTAGS | |
|
||
*.org | ||
yarn-error.log | ||
!Dockerfile.dapper | ||
Dockerfile.dapper* |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -141,4 +141,4 @@ | |
"lib/shared" | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.