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

Add release github actions #55

Merged
merged 3 commits into from
Mar 31, 2023
Merged

Conversation

sohyun-ku
Copy link
Contributor

@sohyun-ku sohyun-ku commented Mar 28, 2023

#52
When pushed to remote repositoryrelease/* branch, create release using github actions.
The behavior is as follows.
1. Checkout code
2. Setup JDK
3. Build project
4. Extract version from commit message
- Commit messages should include the release version.
5. Create Release

plz refer #55 (comment)

@sohyun-ku sohyun-ku requested a review from a team as a code owner March 28, 2023 07:16
@sohyun-ku sohyun-ku self-assigned this Mar 28, 2023
@sohyun-ku sohyun-ku requested a review from junoyoon as a code owner March 28, 2023 07:16
@github-actions
Copy link

github-actions bot commented Mar 28, 2023

Scavenger Test Results

155 files  155 suites   33s ⏱️
254 tests 242 ✔️ 12 💤 0
256 runs  244 ✔️ 12 💤 0

Results for commit 3bce424.

♻️ This comment has been updated with latest results.

distribution: 'zulu'
java-version: '11'
- name: Build project
run: ./gradlew assemble
Copy link
Collaborator

Choose a reason for hiding this comment

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

This only do assemble...
Don't we need release plugin replace SNAHOP version to empty string?

Copy link
Contributor

@taeyeon-Kim taeyeon-Kim Mar 28, 2023

Choose a reason for hiding this comment

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

assemble doesn't run a test. How about replacing it with build task?

Copy link
Contributor Author

@sohyun-ku sohyun-ku Mar 28, 2023

Choose a reason for hiding this comment

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

@junoyoon
This action is just create release & tag when pushed release/* branch.
So if we want to replace SNAPSHOT version to empty string, we'll have to do it by self.

I was some confusion because the operation of the gradle-release plugin was different from the current release step.
It seems to have a similar operation to what you said this #52 (comment), so I'll check again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@taeyeon-Kim
If we create release branch from main branch, I think assemble is enough becuz main branch already build in this actions.

name: Main Build
on:
pull_request:
branches: [ main ]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test with Gradle
run: ./gradlew clean build
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
report_individual_runs: true
check_name: "Scavenger Test Results"
junit_files: "**/build/test-results/**/*.xml"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junoyoon

We can use gradle-release plugin if merging release branch to main is ok.
Using gradle-release commits tag version and new version at working branch.
We want to create tag at release branch, we can use pushReleaseVersionBranch option. (reference)
But using pushReleaseVersionBranch will checkout to the release branch and merge from the working branch.
If we don't use pushReleaseVersionBarnch option, just commit working branch.(in our case maybe working branch is main)

If we decide to use gradle-release plugin, I'd like to proceed release step as follows.

1. Checkout release branch and commit release version by developer.
  - It can be replaced with the gradle release plugin, but for some reason it is difficult to control it with the github action.
2. Using github actions on push event at release branch, trigger gradle-release plugin. 
  - This step is creating TAG.
3. Using github actions on tag event, create Release.

cc. @naver/scavenger-dev

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 review this weekend? ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@junoyoon
#55 (comment) is outdated.
plz refer #55 (comment)
When release, we only have to Pull Request develop to main branch.
Other tasks are done as Github Actions.

@sohyun-ku
Copy link
Contributor Author

sohyun-ku commented Mar 30, 2023

@junoyoon @naver/scavenger-dev

If merging release branch to main is ok,
What about this?

release step as follows.

1. develop -> main PR
  - If we want to release, PR title should be start 'release' and include ${version}
2. If PR is merged, trigger tag github action
  - Remove SNAPSHOT and commit to next version by gradle-release plugin
  - Create Tag in this action
3. If a tag is created, trigger create a release github action
  - Create Release in this action

and git log is as follows.
image

@junoyoon
Copy link
Collaborator

very good!!! go for it!!

@sohyun-ku sohyun-ku force-pushed the feature/add-release-github-actions branch from 3caaa1f to 3bce424 Compare March 31, 2023 02:21
@sohyun-ku
Copy link
Contributor Author

I rebased it with the latest develop branch.

@sohyun-ku sohyun-ku merged commit db17482 into develop Mar 31, 2023
@sohyun-ku sohyun-ku deleted the feature/add-release-github-actions branch March 31, 2023 02:39
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.

4 participants