-
Notifications
You must be signed in to change notification settings - Fork 2
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
maintenance release workflow #93
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,39 +15,41 @@ jobs: | |
releasing: | ||
name: releasing | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
pull-requests: write | ||
timeout-minutes: 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. タイムアウト追加 |
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v2-beta | ||
- uses: actions/setup-node@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. バージョン上げ |
||
with: | ||
node-version: 16 | ||
node-version: 18 | ||
cache: npm | ||
registry-url: 'https://registry.npmjs.org' | ||
Comment on lines
+29
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nodeバージョン上げてますしリリースフロー確認がてらリリースしますか・・:eyes: |
||
- name: Set git user | ||
run: | | ||
git config --global user.email "<>" | ||
git config --global user.name "openameba" | ||
- name: Log in to npm | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | ||
npm whoami | ||
- name: Extract branch from git ref | ||
run: | | ||
echo "::set-output name=name::${GITHUB_REF#refs/*/}" | ||
echo "::set-output name=version::${GITHUB_REF##*/}" | ||
id: extract_branch | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GitHub Actions のアカウントとして設定する(と、見た目がカッコイイ) |
||
- name: Versioning | ||
run: npm version ${{ steps.extract_branch.outputs.version }} | ||
run: npm version "${GITHUB_REF##*/}" | ||
- name: Publish to npm | ||
run: npm publish | ||
run: npm publish --provenance | ||
tokimari marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Push updates | ||
run: | | ||
git push origin ${{ steps.extract_branch.outputs.name }} | ||
git push origin ${{ github.ref_name }} | ||
git push origin --tags | ||
- name: Create Pull Request | ||
run: > | ||
curl | ||
-X POST | ||
-H "Accept: application/vnd.github.v3+json" | ||
-H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" | ||
https://api.github.com/repos/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/pulls | ||
-d '{"head":"${{ steps.extract_branch.outputs.name }}","base":"${{ github.event.repository.default_branch }}","title":"chore(release): publish"}' | ||
gh pr create | ||
--assignee | ||
--base "${{ github.event.repository.default_branch }}" | ||
--body '' | ||
--head "${{ github.ref_name }}" | ||
--title "chore(release): publish" | ||
Comment on lines
+48
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curlで頑張ってPOSTするよりかは現代ではghがあるのでそれを使う |
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
#93 (comment) により追加しました。