Skip to content

Commit ce66cff

Browse files
authored
Changed script in github workflow to relative path (#944)
Signed-off-by: Paul Schultz <[email protected]>
1 parent f69fa52 commit ce66cff

File tree

6 files changed

+106
-77
lines changed

6 files changed

+106
-77
lines changed

Diff for: .github/workflows/che.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
21
# Add Che link on PRs
3-
name: che
2+
name: Che
43

54
on:
6-
pull_request:
5+
pull_request:
76
types: [opened, synchronize]
87

8+
# Only allow one job of this action to be ran at a time
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
add-link:
1115
runs-on: ubuntu-latest

Diff for: .github/workflows/ci.yaml

+5-66
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
pull_request:
88
branches: [main]
99

10+
# Only allow one job of this action to be ran at a time
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
13+
cancel-in-progress: true
14+
1015
jobs:
1116
build-and-validate:
1217
runs-on: ubuntu-latest
@@ -65,69 +70,3 @@ jobs:
6570
run: |
6671
go fmt -x ./...
6772
git diff --exit-code || { echo 'Go sources need to be formatted. Execute "go fmt -x ./..." locally in the 'generator' folder and commit changes to fix an issue'; exit 1; }
68-
- name: Upload Json schemas
69-
uses: actions/upload-artifact@v2
70-
with:
71-
name: devfile-json-schema
72-
path: schemas/latest/devfile.json
73-
74-
publish-next-json-schema:
75-
if: success() && github.event_name == 'push'
76-
runs-on: ubuntu-latest
77-
needs: [build-and-validate]
78-
steps:
79-
- name: Setup Python
80-
uses: actions/setup-python@v4
81-
with:
82-
python-version: '3.9'
83-
84-
- name: Checkout devfile docs
85-
uses: actions/checkout@v2
86-
with:
87-
repository: devfile/devfile-web
88-
persist-credentials: false
89-
path: devfile-web-repo
90-
91-
- name: Checkout devfile api
92-
uses: actions/checkout@v2
93-
with:
94-
path: api-repo
95-
96-
- name: Get the version being published
97-
id: get_version
98-
run: echo ::set-output name=version::$(cat api-repo/schemas/latest/jsonSchemaVersion.txt)
99-
100-
- name: Publish the new version on devfile-web
101-
run: |
102-
cd devfile-web-repo/
103-
python devfile-web-repo/python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema api-repo/schemas/latest/devfile.json --release
104-
105-
- name: Push to the devfile/devfile-web repo
106-
working-directory: devfile-web-repo/
107-
run: |
108-
# Install dependencies to format the commit
109-
yarn install
110-
111-
# Format the commit
112-
yarn nx format:write
113-
114-
# Lint the commit
115-
yarn nx affected --target=lint
116-
yarn nx format:check
117-
118-
# Don't commit if there are no changes
119-
if [ "$(git status -s)" == "" ]; then
120-
echo "Nothing to commit"
121-
exit 0
122-
fi
123-
124-
lastCommit="$(cd ../api-repo; git log -1 --format=%H)"
125-
lastCommitterName="$(cd ../api-repo; git log -1 --format=%an)"
126-
lastCommitterEmail="$(cd ../api-repo; git log -1 --format=%ae)"
127-
128-
git config --global user.email "${lastCommitterEmail}"
129-
git config --global user.name "${lastCommitterName}"
130-
131-
git add .
132-
git commit -asm "Update devfile schema based on devfile/api@${lastCommit}"
133-
git push "https://devfile-robot:${{secrets.DOCS_UPDATE_SECRET}}@github.com/devfile/devfile-web"

Diff for: .github/workflows/codecov.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ on:
33
push:
44
branches:
55
- main
6+
7+
# Only allow one job of this action to be ran at a time
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
10+
cancel-in-progress: true
11+
612
jobs:
713
build-and-deploy:
814
runs-on: ubuntu-20.04

Diff for: .github/workflows/publish-devfile-schema.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Publish Devfile Schema
2+
3+
# Triggers the workflow on push events but only for the main branch
4+
on:
5+
push:
6+
branches: [main]
7+
8+
# Only allow one job of this action to be ran at a time
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
publish-json-schema:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Setup Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.9'
21+
22+
- name: Checkout devfile/devfile-web
23+
uses: actions/checkout@v2
24+
with:
25+
repository: devfile/devfile-web
26+
persist-credentials: false
27+
path: devfile-web-repo
28+
29+
- name: Checkout devfile api
30+
uses: actions/checkout@v2
31+
with:
32+
path: api-repo
33+
34+
- name: Get the version being published
35+
id: get_version
36+
run: echo ::set-output name=version::$(cat api-repo/schemas/latest/jsonSchemaVersion.txt)
37+
38+
- name: Publish the new version on devfile-web
39+
working-directory: devfile-web-repo/
40+
run: |
41+
python ./python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema ../api-repo/schemas/latest/devfile.json
42+
43+
- name: Push to the devfile/devfile-web repo
44+
working-directory: devfile-web-repo/
45+
run: |
46+
# Install dependencies to format the commit
47+
yarn install
48+
49+
# Format the commit
50+
yarn nx format:write
51+
52+
# Lint the commit
53+
yarn nx affected --target=lint
54+
yarn nx format:check
55+
56+
# Don't commit if there are no changes
57+
if [ "$(git status -s)" == "" ]; then
58+
echo "Nothing to commit"
59+
exit 0
60+
fi
61+
62+
lastCommit="$(cd ../api-repo; git log -1 --format=%H)"
63+
lastCommitterName="$(cd ../api-repo; git log -1 --format=%an)"
64+
lastCommitterEmail="$(cd ../api-repo; git log -1 --format=%ae)"
65+
66+
git config --global user.email "${lastCommitterEmail}"
67+
git config --global user.name "${lastCommitterName}"
68+
69+
git add .
70+
git commit -asm "Update devfile schema based on devfile/api@${lastCommit}"
71+
git push "https://devfile-robot:${{secrets.DOCS_UPDATE_SECRET}}@github.com/devfile/devfile-web"

Diff for: .github/workflows/release-schema.yaml renamed to .github/workflows/release-devfile-schema.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
release:
66
types: [published]
77

8+
# Only allow one job of this action to be ran at a time
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
12+
813
jobs:
914
release-json-schema:
1015
runs-on: ubuntu-latest
@@ -31,9 +36,9 @@ jobs:
3136
run: echo ::set-output name=version::$(cat api-repo/schemas/latest/jsonSchemaVersion.txt)
3237

3338
- name: Release new version on devfile-web
39+
working-directory: devfile-web-repo/
3440
run: |
35-
cd devfile-web-repo/
36-
python devfile-web-repo/python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema api-repo/schemas/latest/devfile.json --release
41+
python ./python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema ../api-repo/schemas/latest/devfile.json --release
3742
3843
- name: Push to the devfile/devfile-web repo
3944
working-directory: devfile-web-repo/

Diff for: .github/workflows/release-typescript-models.yaml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
21
# Release a typescript package to npm containing the typescript types generated from the latest merged crds
3-
name: types
2+
name: Release Typescript Models
43

54
on:
65
push:
7-
branches: [ main ]
6+
branches: [main]
7+
8+
# Only allow one job of this action to be ran at a time
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
11+
cancel-in-progress: true
812

913
jobs:
1014
release-typescript-models:
@@ -23,7 +27,7 @@ jobs:
2327
- name: Install Python dependencies
2428
uses: py-actions/py-dependency-install@v2
2529
with:
26-
path: "api/build/typescript-model/requirements.txt"
30+
path: 'api/build/typescript-model/requirements.txt'
2731

2832
- name: Setup node
2933
uses: actions/setup-node@v1
@@ -37,8 +41,8 @@ jobs:
3741
./build/typescript-model/generate.sh
3842
cp -r ./build/typescript-model/workdir/typescript-models ../
3943
working-directory: api
40-
41-
- name: Release typescript models
44+
45+
- name: Release typescript models
4246
run: |
4347
VERSION=$(cat $GITHUB_WORKSPACE/api/schemas/latest/jsonSchemaVersion.txt)
4448
yarn --new-version version "$VERSION-$(date +%s)" --no-git-tag-version

0 commit comments

Comments
 (0)