Skip to content
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

ci: update release workflow #352

Merged
merged 6 commits into from
Oct 25, 2023
Merged

Conversation

princerajpoot20
Copy link
Member

@princerajpoot20 princerajpoot20 commented Oct 8, 2023

Description

Update release workflow.

Related issue(s)

Fixes #282

cc @derberg

package.json Outdated
@@ -36,8 +36,7 @@
"lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix",
"generate:assets": "npm run generate:readme:toc",
"generate:readme:toc": "markdown-toc -i README.md",
"generate:docker": "docker build --tag asyncapi/server-api .",
"release": "npm run generate:docker && semantic-release"
"generate:docker": "docker build --tag asyncapi/server-api ."
Copy link
Member

@derberg derberg Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now I noticed that release workflows here are mixed with docker release. There are some additional changes that you need to do, sorry about that

Suggested change
"generate:docker": "docker build --tag asyncapi/server-api ."
"docker:build": "docker build --tag asyncapi/server-api ."

you also need to add a new file, called release-docker.yml like below"

name: Release Docker Image
on: 
  release:
    types: 
      - published
jobs:

  publish-docker:
    name: Generating Docker
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - 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 ${{secrets.DOCKER_PASSWORD}} | docker login -u ${{secrets.DOCKER_USERNAME}} --password-stdin
          npm run docker:build
          docker tag asyncapi/server-api:latest asyncapi/server-api:${{ steps.version.outputs.value }}
          docker push asyncapi/server-api:${{ steps.version.outputs.value }}
          docker push asyncapi/server-api:latest

      - uses: meeDamian/sync-readme@82715041300710d9be7c726c9d6c683b70451087 #version 1.0.6 https://github.com/meeDamian/sync-readme/releases/tag/v1.0.6
        with:
          user: ${{secrets.DOCKER_USERNAME}}
          pass: ${{ secrets.DOCKER_PASSWORD }}
          slug: asyncapi/server-api
          description: Server with API that exposes various AsyncAPI tools like AsyncAPI Generator

@princerajpoot20
Copy link
Member Author

@derberg made the changes 🙂

package.json Outdated
@@ -79,9 +78,6 @@
},
"devDependencies": {
"@semantic-release-plus/docker": "^3.1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this too, and refresh package-lock

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@princerajpoot20 have a look please

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derberg Done 👍 . Sorry for the delay

derberg
derberg previously approved these changes Oct 9, 2023
Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done 👏🏼

@BOLT04 you can approve and merge

package.json Outdated
@@ -36,8 +36,7 @@
"lint:fix": "eslint --max-warnings 0 --config .eslintrc . --fix",
"generate:assets": "npm run generate:readme:toc",
"generate:readme:toc": "markdown-toc -i README.md",
"generate:docker": "docker build --tag asyncapi/server-api .",
"release": "npm run generate:docker && semantic-release"
"docker:build": "docker build --tag asyncapi/server-api ."
Copy link
Member

@derberg derberg Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"docker:build": "docker build --tag asyncapi/server-api ."
"docker:build": "docker build --tag asyncapi/server-api .",
"bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION"

please commit it as this is one more missing script that is required

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derberg Done

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BOLT04 @smoya ready to merge from my side

@smoya
Copy link
Member

smoya commented Oct 25, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit 6075a82 into asyncapi:master Oct 25, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need for urgent changes in GitHub Actions automation
4 participants