-
Notifications
You must be signed in to change notification settings - Fork 66
Changed script in github workflow to relative path #944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bb7587c
Changed script in github workflow to relative path
schultzp2020 26993c1
changed path for json schema
schultzp2020 08950c7
Split publish-json-schema into its own action and added concurrency c…
schultzp2020 83d17fe
removed dep form publish devfile schema
schultzp2020 a75815a
removed publish-devfile-schema action on pr
schultzp2020 780f87e
fixed path issue on release-devfile-schema action
schultzp2020 2759b67
renamed a step in publish-devfile-schema
schultzp2020 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,71 @@ | ||
name: Publish Devfile Schema | ||
|
||
# Triggers the workflow on push events but only for the main branch | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
# Only allow one job of this action to be ran at a time | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish-json-schema: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Checkout devfile docs | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: devfile/devfile-web | ||
persist-credentials: false | ||
path: devfile-web-repo | ||
|
||
- name: Checkout devfile api | ||
uses: actions/checkout@v2 | ||
with: | ||
path: api-repo | ||
|
||
- name: Get the version being published | ||
id: get_version | ||
run: echo ::set-output name=version::$(cat api-repo/schemas/latest/jsonSchemaVersion.txt) | ||
|
||
- name: Publish the new version on devfile-web | ||
working-directory: devfile-web-repo/ | ||
run: | | ||
python ./python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema ../api-repo/schemas/latest/devfile.json | ||
|
||
- name: Push to the devfile/devfile-web repo | ||
working-directory: devfile-web-repo/ | ||
run: | | ||
# Install dependencies to format the commit | ||
yarn install | ||
|
||
# Format the commit | ||
yarn nx format:write | ||
|
||
# Lint the commit | ||
yarn nx affected --target=lint | ||
yarn nx format:check | ||
|
||
# Don't commit if there are no changes | ||
if [ "$(git status -s)" == "" ]; then | ||
echo "Nothing to commit" | ||
exit 0 | ||
fi | ||
|
||
lastCommit="$(cd ../api-repo; git log -1 --format=%H)" | ||
lastCommitterName="$(cd ../api-repo; git log -1 --format=%an)" | ||
lastCommitterEmail="$(cd ../api-repo; git log -1 --format=%ae)" | ||
|
||
git config --global user.email "${lastCommitterEmail}" | ||
git config --global user.name "${lastCommitterName}" | ||
|
||
git add . | ||
git commit -asm "Update devfile schema based on devfile/api@${lastCommit}" | ||
git push "https://devfile-robot:${{secrets.DOCS_UPDATE_SECRET}}@github.com/devfile/devfile-web" |
This file contains hidden or 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 | ||||
---|---|---|---|---|---|---|
|
@@ -5,6 +5,11 @@ on: | |||||
release: | ||||||
types: [published] | ||||||
|
||||||
# Only allow one job of this action to be ran at a time | ||||||
concurrency: | ||||||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||||||
cancel-in-progress: true | ||||||
|
||||||
jobs: | ||||||
release-json-schema: | ||||||
runs-on: ubuntu-latest | ||||||
|
@@ -33,7 +38,7 @@ jobs: | |||||
- name: Release new version on devfile-web | ||||||
run: | | ||||||
cd devfile-web-repo/ | ||||||
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 | ||||||
python ./python/src/api_workflow/api_workflow.py --version ${{ steps.get_version.outputs.version }} --devfile-schema api-repo/schemas/latest/devfile.json --release | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
should be? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed already |
||||||
|
||||||
- name: Push to the devfile/devfile-web repo | ||||||
working-directory: devfile-web-repo/ | ||||||
|
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you rename this step, no longer called devfile docs, probably devfile-web?