Skip to content

📚 README 업데이트: 한국어 문서 추가 및 기능 설명 보강 #33

📚 README 업데이트: 한국어 문서 추가 및 기능 설명 보강

📚 README 업데이트: 한국어 문서 추가 및 기능 설명 보강 #33

Workflow file for this run

name: Release RC
on:
issue_comment:
types:
- created
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write # to create release
jobs:
canary:
if: ${{ github.event.issue.pull_request && (github.event.comment.body == 'rc-publish' || github.event.comment.body == '/rc-publish')}}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SKIP_COMMIT_HELPER_POSTINSTALL: 1
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
steps:
- name: Get PR branch name
id: get_branch
run: |
PR=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" ${{ github.event.issue.pull_request.url }})
echo "branch=$(echo $PR | jq -r '.head.ref')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
ref: ${{ steps.get_branch.outputs.branch }}
fetch-depth: 0
- name: Ensure local main branch exists and is up to date
run: |
git fetch origin main
git branch -f main origin/main
- uses: actions/setup-go@v4
with:
go-version: '1.24'
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: checkIfCommitHelperGoWillBePublished
id: checkCommitHelperGo
run: |
pnpm changeset status > changeset-status.txt
isPublished=$(grep -q "@naverpay/commithelper-go" changeset-status.txt && echo "true" || echo "false")
if [ "$isPublished" = "false" ]; then
echo "commithelperGoWillBePublished=false" >> $GITHUB_ENV
else
echo "commithelperGoWillBePublished=true" >> $GITHUB_ENV
fi
- name: RC Publish
uses: NaverPayDev/changeset-actions/canary-publish@main
with:
github_token: ${{ secrets.ACTION_TOKEN }}
npm_tag: rc
npm_token: ${{ secrets.NPM_TOKEN }}
publish_script: pnpm run release:canary
packages_dir: packages
excludes: '.turbo,.github'
version_template: '{VERSION}-rc.{DATE}-{COMMITID7}'
create_release: true
- name: getReleaseUploadUrlOfCommitHelperGo
id: getRelease
if: env.commithelperGoWillBePublished == 'true'
run: |
packageVersion=$(cat packages/commithelper-go/package.json | jq -r '.version')
releaseTag="@naverpay/commithelper-go@$packageVersion"
apiUrl="https://api.github.com/repos/NaverPayDev/cli/releases/tags/$releaseTag"
uploadUrl=$(curl -s -H "Authorization: Bearer ${{ secrets.ACTION_TOKEN }}" $apiUrl | jq -r '.upload_url')
echo "upload_url=$uploadUrl" >> $GITHUB_ENV
- name: Wait for release to be ready
if: env.commithelperGoWillBePublished == 'true'
run: sleep 5
- name: Check asset exists
if: env.commithelperGoWillBePublished == 'true'
run: ls -l packages/commithelper-go/bin/
- name: uploadWindowsBinary
if: env.commithelperGoWillBePublished == 'true'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.upload_url }}
asset_path: packages/commithelper-go/dist/commithelper-go-windows-amd64.exe
asset_name: commithelper-go-windows-amd64.exe
asset_content_type: application/octet-stream
- name: uploadMacosAmd64Binary
if: env.commithelperGoWillBePublished == 'true'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.upload_url }}
asset_path: packages/commithelper-go/dist/commithelper-go-darwin-amd64
asset_name: commithelper-go-darwin-amd64
asset_content_type: application/octet-stream
- name: uploadMacosArm64Binary
if: env.commithelperGoWillBePublished == 'true'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.upload_url }}
asset_path: packages/commithelper-go/dist/commithelper-go-darwin-arm64
asset_name: commithelper-go-darwin-arm64
asset_content_type: application/octet-stream
- name: uploadLinuxBinary
if: env.commithelperGoWillBePublished == 'true'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ env.upload_url }}
asset_path: packages/commithelper-go/dist/commithelper-go-linux-amd64
asset_name: commithelper-go-linux-amd64
asset_content_type: application/octet-stream