-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
feat: add workflow to release github-action #1543
Merged
Shurtu-gal
merged 14 commits into
asyncapi:master
from
akshatnema:add-docker-version-update-workflow
Oct 27, 2024
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ef9888b
added workflow
akshatnema 565e9b9
updated workflow
akshatnema b181f85
added a manual workflow
akshatnema edd9783
updated workflow
akshatnema 539afe7
deleted manual workflow
akshatnema b2be0c0
updated workflow
akshatnema f8af55c
deleted act script
akshatnema 8eb65b4
updated git config inside github workflow
akshatnema 3202da2
updated npm script in github workflow
akshatnema 72d367d
Updated workflow trigger at pre release
akshatnema 8f4bd9e
Merge branch 'master' into add-docker-version-update-workflow
akshatnema 19fab83
added new plugin for semantic release of project
akshatnema 54ec2e8
updated plugin
akshatnema 8fa7572
Merge branch 'asyncapi:master' into add-docker-version-update-workflow
akshatnema 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 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,56 @@ | ||
name: Release Github action for CLI | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
release-action-yml: | ||
name: Release github action for cli and update version in action.yml | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
|
||
- name: Get version without v character | ||
id: version | ||
run: | | ||
VERSION=${{github.event.release.tag_name}} | ||
VERSION_WITHOUT_V=${VERSION:1} | ||
echo "value=${VERSION_WITHOUT_V}" >> $GITHUB_OUTPUT | ||
- name: Release to Docker | ||
run: | | ||
echo ${{env.DOCKER_PASSWORD}} | docker login -u ${{env.DOCKER_USERNAME}} --password-stdin | ||
npm run action:docker:build | ||
docker tag asyncapi/github-action-for-cli:latest asyncapi/github-action-for-cli:${{ steps.version.outputs.value }} | ||
docker push asyncapi/github-action-for-cli:${{ steps.version.outputs.value }} | ||
docker push asyncapi/github-action-for-cli:latest | ||
|
||
- name: Update action.yml with version | ||
run: | | ||
VERSION=${{ steps.version.outputs.value }} | ||
sed "s/\\\${ version }/${VERSION}/g" action-template.yml > action.yml | ||
|
||
- name: Create branch | ||
run: | | ||
git checkout -b update-action-docker-version-${{ github.sha }} | ||
|
||
- name: Commit and push | ||
run: | | ||
git config --global user.name asyncapi-bot | ||
git config --global user.email info@asyncapi.io | ||
git add action.yml | ||
git commit -m "chore(action): update docker version in action.yml" | ||
git push https://${{ env.GITHUB_TOKEN }}@github.com/asyncapi/cli | ||
|
||
- name: Create PR | ||
run: | | ||
gh pr create --title "chore(action): update docker version in action.yml" --body "Updated docker version of github action in action.yml" --head "update-action-docker-version-${{ github.sha }}" |
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,54 @@ | ||
name: 'Generator, Validator, Converter and others - all in one for your AsyncAPI docs' | ||
description: 'Use this action to generate docs or code from your AsyncAPI document. Use default templates or provide your custom ones.' | ||
inputs: | ||
cli_version: | ||
description: 'Version of AsyncAPI CLI to be used. This is only needed if you want to test with a specific version of AsyncAPI CLI. Default is latest which is also the recommended option.' | ||
required: false | ||
default: '' | ||
command: | ||
description: 'Command to run. Available commands in action :- generate, validate, convert, optimize and custom. Default is generate. For custom command, provide the whole command as input. List of available commands can be found in https://www.asyncapi.com/docs/tools/cli/usage.' | ||
required: false | ||
default: 'generate' | ||
filepath: | ||
description: 'Path to AsyncAPI document. This input is required if command is set to generate, validate, convert or optimize. Default is ./asyncapi.yaml' | ||
required: false | ||
default: 'asyncapi.yml' | ||
template: | ||
description: 'Template for the generator. Official templates are listed here https://github.com/search?q=topic%3Aasyncapi+topic%3Agenerator+topic%3Atemplate. You can pass template as npm package, url to git repository, link to tar file or local template.' | ||
default: '@asyncapi/markdown-template@0.10.0' | ||
required: false | ||
language: | ||
description: 'Language of the generated code. This input is required if you want to generate models. List of available languages can be found in https://www.asyncapi.com/docs/tools/cli/usage#asyncapi-generate-models-language-file' | ||
required: false | ||
default: '' | ||
output: | ||
description: 'Directory where to put the generated files. Can be used only with generate or convert commands. Default is output.' | ||
required: false | ||
default: 'output' | ||
parameters: | ||
description: 'The command that you use might support and even require specific parameters to be passed to the CLI for the generation. Template parameters should be preceded by -p' | ||
required: false | ||
default: '' | ||
custom_command: | ||
description: 'Custom command to be run. This input is required if command is set to custom.' | ||
required: false | ||
default: '' | ||
|
||
runs: | ||
using: 'docker' | ||
# This is the image that will be used to run the action. | ||
# IMPORTANT: The version has to be changed manually in your PRs. | ||
image: 'docker://asyncapi/github-action-for-cli:${ version }' | ||
args: | ||
- ${{ inputs.cli_version }} | ||
- ${{ inputs.command }} | ||
- ${{ inputs.filepath }} | ||
- ${{ inputs.template }} | ||
- ${{ inputs.language }} | ||
- ${{ inputs.output }} | ||
- ${{ inputs.parameters }} | ||
- ${{ inputs.custom_command }} | ||
|
||
branding: | ||
icon: 'file-text' | ||
color: purple |
Oops, something went wrong.
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.
The update to this action.yml won't be a part of the release though if this is done like this.
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.
@Shurtu-gal Yeah, do you want to run this workflow as part of pre-release or this update should be done before we build docker image of github-action?
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.
@akshatnema pre-release