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: improve release workflow #767

Merged
merged 4 commits into from
Aug 3, 2023
Merged

Conversation

sasaplus1
Copy link
Member

@sasaplus1 sasaplus1 commented Jul 31, 2023

release workflow を改良しました。

@sasaplus1 sasaplus1 self-assigned this Jul 31, 2023
@@ -22,6 +22,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
Copy link
Member Author

Choose a reason for hiding this comment

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

.npmrc のセットアップをsetup-nodeにしてもらいます。

@@ -30,17 +31,14 @@ jobs:
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-v2
- run: npm install -g npm@9
Copy link
Member Author

Choose a reason for hiding this comment

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

--provenance で公開したいので npm9 にします。

Comment on lines +40 to +41
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
Copy link
Member Author

Choose a reason for hiding this comment

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

コミットしたユーザーがGitHub Actionsのように表示されます。
openameba/ameba-color-palette.css#93 (comment)

@@ -51,6 +49,8 @@ jobs:
run: yarn lerna publish ${{ steps.extract_branch.outputs.version }} --conventional-commits --create-release github --yes --no-private
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
Copy link
Member Author

Choose a reason for hiding this comment

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

npm から直接公開するのではないため --provenance の代わりに環境変数で対応します。

@@ -51,6 +49,8 @@ jobs:
run: yarn lerna publish ${{ steps.extract_branch.outputs.version }} --conventional-commits --create-release github --yes --no-private
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

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

.npmrc の設定を setup-node にしているため NODE_AUTH_TOKENNPM_TOKEN を指定しています。

@sasaplus1 sasaplus1 requested review from herablog and tokimari July 31, 2023 06:30
@sasaplus1 sasaplus1 marked this pull request as ready for review July 31, 2023 06:30
@@ -51,6 +49,8 @@ jobs:
run: yarn lerna publish ${{ steps.extract_branch.outputs.version }} --conventional-commits --create-release github --yes --no-private
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Create Pull Request
run: >
curl
Copy link
Member Author

Choose a reason for hiding this comment

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

gh コマンドに変えようかと思いましたが、たしかAPI経由で実行しないとワークフローが実行されない関係でこの記述をしていた記憶があったのでとりあえず変更しませんでした。

Copy link
Contributor

@tokimari tokimari left a comment

Choose a reason for hiding this comment

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

エンジニアを褒めるネコ:いつも助かります(誤字注意)

@sasaplus1 sasaplus1 merged commit 6ccd60e into main Aug 3, 2023
@sasaplus1 sasaplus1 deleted the feature/improve-release-workflow branch August 3, 2023 02:06
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.

2 participants