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

releaseをworkflow_dispatch経由で実行できるようにする #425

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

ryokosuge
Copy link
Contributor

@ryokosuge ryokosuge commented Aug 11, 2021

やったこと

  • releaseのworkflowをworkflow_dispatchで実行できるようにした
    • 今までのやつだとcommit hashに問題があってreleaseのcommitとmasterのcommitログが合わなくなってしまっていたので、masterブランチで直接作業してreleaseするようにした

こんな感じでリリースできるようにする

スクリーンショット 2021-08-11 15 32 28

@ryokosuge ryokosuge requested a review from a team as a code owner August 11, 2021 06:29
@ryokosuge ryokosuge requested review from youchann and removed request for a team August 11, 2021 06:29
@ryokosuge ryokosuge self-assigned this Aug 11, 2021
@netlify
Copy link

netlify bot commented Aug 11, 2021

✔️ Deploy Preview for ingred-ui ready!

🔨 Explore the source changes: 05ab3d9

🔍 Inspect the deploy log: https://app.netlify.com/sites/ingred-ui/deploys/61136e3860f6cc0007a01caa

😎 Browse the preview: https://deploy-preview-425--ingred-ui.netlify.app

@ryokosuge ryokosuge added the enhancement New feature or request label Aug 11, 2021

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
ref: ${{ github.event.ref }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

workflow_dispatchで指定したブランチを使えるように(ほぼmasterだけど)

- name: create CHANGELOG
run: make -f ci.mk changelog
env:
RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }}
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

inputで指定したバージョンを使う

Comment on lines -33 to -39
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/heads\/release\//}
- name: Extract branch name
shell: bash
run: echo ::set-output name=BRANCH::${GITHUB_REF/refs\/heads\//}
id: extract_branch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

今まではリリースバージョンを release/*.*.* のブランチ名から取得していたけどいらなくなったので削除

Comment on lines -48 to -66
RELEASE_VERSION: ${{ steps.get_version.outputs.VERSION }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.FLUCT_MEMBER_GITHUB_TOKEN }}
title: release v${{ env.RELEASE_VERSION }}
body: |
## Check List
- [ ] CHANGELOGの確認
- [ ] [v${{ env.RELEASE_VERSION }}のdraftリリースノート](https://github.com/voyagegroup/ingred-ui/releases)をpublish

## releaseを取り消す場合
1. [v${{ env.RELEASE_VERSION }}のdraftリリース](https://github.com/voyagegroup/ingred-ui/releases)を削除
2. このPRを閉じる
3. ブランチを削除
labels: release
base: master
branch: ${{ env.RELEASE_BRANCH }}
commit-message: "[ci skip] release v${{ env.RELEASE_VERSION }}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

PRは作らず直接commit -> pushして npm publishする流れにした

Copy link
Contributor

@youchann youchann left a comment

Choose a reason for hiding this comment

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

LGTMです!

@ryokosuge ryokosuge merged commit 7657aaa into master Aug 11, 2021
@ryokosuge ryokosuge deleted the feature/release-workflow branch August 11, 2021 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants