-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Release setup for backend Signed-off-by: Ali Ok <[email protected]> * Release setup for plugins Signed-off-by: Ali Ok <[email protected]> * Fix NPM publish Signed-off-by: Ali Ok <[email protected]> * Switch plugin `main` version to 0.0.0-nightly Signed-off-by: Ali Ok <[email protected]> * Set release version of NPM package to GitHub release name Signed-off-by: Ali Ok <[email protected]> * Allow passing release name to the manual workflow dispatch Signed-off-by: Ali Ok <[email protected]> --------- Signed-off-by: Ali Ok <[email protected]>
- Loading branch information
Showing
9 changed files
with
181 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish release on NPM | ||
|
||
on: | ||
# When manually triggered | ||
workflow_dispatch: | ||
inputs: | ||
releaseName: | ||
description: 'Release name, e.g. v1.2.3' | ||
required: true | ||
|
||
# When there's a release created | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
publish-release-on-npm: | ||
name: Publish release on NPM | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup release name | ||
run: | | ||
if [ -z "${{ github.event.release.name }}" ]; then | ||
echo "RELEASE_NAME=${{ github.event.inputs.releaseName }}" >> $GITHUB_ENV | ||
else | ||
echo "RELEASE_NAME=${{ github.event.release.name }}" >> $GITHUB_ENV | ||
fi | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'backstage/.nvmrc' | ||
cache: 'yarn' | ||
cache-dependency-path: 'backstage/yarn.lock' | ||
|
||
- name: Print environment | ||
run: | | ||
node --version | ||
yarn --version | ||
- name: Print release name | ||
run: | | ||
echo "Release name: ${RELEASE_NAME}" | ||
- name: Install dependencies | ||
shell: bash | ||
working-directory: ./backstage | ||
run: yarn --prefer-offline --frozen-lockfile | ||
|
||
- name: Install tooling | ||
shell: bash | ||
working-directory: ./backstage | ||
run: npm install @backstage/cli -g | ||
|
||
- name: Run tests | ||
shell: bash | ||
working-directory: ./backstage | ||
run: | | ||
export PATH="./node_modules/.bin/:$PATH" | ||
yarn test | ||
- name: Build | ||
shell: bash | ||
working-directory: ./backstage | ||
run: | | ||
export PATH="./node_modules/.bin/:$PATH" | ||
yarn tsc | ||
yarn build | ||
- name: Update version of knative-event-mesh-backend plugin | ||
shell: bash | ||
working-directory: ./backstage/plugins/knative-event-mesh-backend | ||
run: | | ||
export PATH="./node_modules/.bin/:$PATH" | ||
yarn version --new-version ${RELEASE_NAME} --no-git-tag-version | ||
- name: Publish knative-event-mesh-backend plugin | ||
uses: JS-DevTools/npm-publish@v2 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
access: public | ||
package: backstage/plugins/knative-event-mesh-backend |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"packages": ["packages/*", "plugins/*"], | ||
"npmClient": "yarn", | ||
"version": "0.1.0", | ||
"version": "0.0.0-nightly", | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json" | ||
} |
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,4 @@ | ||
# keep this file so that npm doesn't use the .gitignore file | ||
src/ | ||
.eslintrc.js | ||
app-config.yaml |
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
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2023 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Documentation about this script and how to use it can be found | ||
# at https://github.com/knative/test-infra/tree/master/ci | ||
|
||
source $(dirname $0)/../vendor/knative.dev/hack/release.sh | ||
|
||
export GO111MODULE=on | ||
|
||
# Yaml files to generate, and the source config dir for them. | ||
declare -A COMPONENTS | ||
COMPONENTS=( | ||
["eventmesh.yaml"]="backends/config/100-eventmesh" | ||
) | ||
readonly COMPONENTS | ||
|
||
function build_release() { | ||
# Update release labels if this is a tagged release | ||
if [[ -n "${TAG}" ]]; then | ||
echo "Tagged release, updating release labels to app.kubernetes.io/version: \"${TAG}\"" | ||
LABEL_YAML_CMD=(sed -e "s|app.kubernetes.io/version: devel|app.kubernetes.io/version: \"${TAG}\"|") | ||
else | ||
echo "Untagged release, will NOT update release labels" | ||
LABEL_YAML_CMD=(cat) | ||
fi | ||
|
||
local all_yamls=() | ||
for yaml in "${!COMPONENTS[@]}"; do | ||
local config="${COMPONENTS[${yaml}]}" | ||
echo "Building Knative Backstage Backends - ${config}" | ||
ko resolve -j 1 ${KO_FLAGS} -f ${config}/ | "${LABEL_YAML_CMD[@]}" > ${yaml} | ||
all_yamls+=(${yaml}) | ||
done | ||
|
||
ARTIFACTS_TO_PUBLISH="${all_yamls[@]}" | ||
} | ||
|
||
main $@ |
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,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2023 The Knative Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# This script runs the presubmit tests; it is started by prow for each PR. | ||
# For convenience, it can also be executed manually. | ||
# Running the script without parameters, or with the --all-tests | ||
# flag, causes all tests to be executed, in the right order. | ||
# Use the flags --build-tests, --unit-tests and --integration-tests | ||
# to run a specific set of tests. | ||
|
||
export GO111MODULE=on | ||
export DISABLE_MD_LINTING=1 | ||
|
||
source $(dirname "$0")/../vendor/knative.dev/hack/presubmit-tests.sh | ||
|
||
main $@ |