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

feat: Enable Versioning #98

Closed
wants to merge 2 commits into from
Closed

feat: Enable Versioning #98

wants to merge 2 commits into from

Conversation

HanZ1203
Copy link

Description

Enable versioning for GCP Scanner with GitHub release and tag.

Changes Made

Add a YAML file to modify GitHub Action workflow.

Usage

Step 1: commit
Step 2: assign a tag.
git tag v1.0.0 -m 'test for versioning'
Step 3: push.
git push origin v1.0.0
Result: a release and a tag are automatically generated.

Related Issues

#20
related pr: #35

Additional Notes

This function requires configuring the workflow permissions with 'Read and Write permissions'.

@google-cla
Copy link

google-cla bot commented Mar 13, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mshudrak
Copy link
Collaborator

Please accept Google CLA

- uses: actions/checkout@v3

- name: Create Release
uses: ncipollo/release-action@v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like in PR #35, we don't want extra third-party dependencies here, especially for the release process. We would prefer to explore native Github mechanism (if any) for that.

Copy link
Author

Choose a reason for hiding this comment

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

Understood. Thanks a lot for the advice. I will be working on that.

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload asset
uses: svenstaro/upload-release-action@v2
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here.

Copy link
Author

Choose a reason for hiding this comment

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

Understood.

Signed-off-by: zhanghan <290459366@qq.com>
@HanZ1203 HanZ1203 requested a review from mshudrak March 15, 2023 08:57
@HanZ1203
Copy link
Author

Like in PR #35, we don't want extra third-party dependencies here, especially for the release process. We would prefer to explore native Github mechanism (if any) for that.

Hi, I have removed the third-party dependencies and committed a new file. I have made tests and it works fine in my forked repository. I also added the usage and notes in the file. Please take a look:).

# Note that the release automatically contains source code, the upload assets can be a description file of this version, e.g. change.txt
- name: Create Release
run: |
gh release create ${{ github.ref }} ./*.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, but we would prefer to move forward with solution in #100

Copy link
Author

@HanZ1203 HanZ1203 Mar 15, 2023

Choose a reason for hiding this comment

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

Thanks, but we would prefer to move forward with solution in #100

Thanks for your reply. I viewed the solution in #100. The release is achieved via a GitHub action release-please-action (https://github.com/marketplace/actions/release-please-action). It seems still a third-party dependency created by some contributors and published on the GitHub action marketplace, similar to those actions I used in my prior PR version. That's why I use the gh command.
Please let me know if the release-please-action is ok. Then I'm glad to update my YAML file and solve this versioning issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let me think for a bit on this solution vs #100.

Copy link
Author

Choose a reason for hiding this comment

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

Let me think for a bit on this solution vs #100.

Sure!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I will try #100 and if we don't like it we will move with this solution.

@mshudrak
Copy link
Collaborator

We will release manually via Github Actions. It has enough features in order to do that.

@mshudrak mshudrak closed this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants