This repository was archived by the owner on Jan 29, 2026. It is now read-only.
trackScreen에 nol_device_id 기록 #2459
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD | |
| on: | |
| push: | |
| branches-ignore: | |
| - '**' | |
| tags: | |
| - 'release-prod-*' | |
| - 'release-pr-*' | |
| env: | |
| GITHUB_API_URL_BASE: https://api.github.com/repos/${{ github.repository }} | |
| # Node.js | |
| NODE_VERSION: 'lts/*' | |
| PNPM_VERSION: '9' | |
| NPM_REGISTRY_URL: 'https://registry.npmjs.org' | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_ONLY_NPM_TOKEN }} | |
| HUSKY: 0 | |
| # Nx Cloud | |
| NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | |
| jobs: | |
| wait-for-ci: | |
| runs-on: ${{ vars.NOL_RUNNER }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: ${{ env.NPM_REGISTRY_URL }} | |
| # cache: 'pnpm' | |
| - name: Wait for CI | |
| uses: fountainhead/action-wait-for-check@v1.1.0 | |
| id: wait-for-ci | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| checkName: build | |
| - name: Shutdown workflow | |
| if: steps.wait-for-ci.outputs.conclusion != 'success' | |
| run: node -e 'process.exit(1)' | |
| release: | |
| needs: wait-for-ci | |
| if: startsWith(github.event.ref, 'refs/tags/release-prod-') | |
| runs-on: ${{ vars.NOL_RUNNER }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: ${{ env.NPM_REGISTRY_URL }} | |
| # cache: 'pnpm' | |
| - name: Get release version | |
| run: echo "DEPLOY_VERSION=v$(cat ./lerna.json | jq -r '.version')" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_ONLY_NPM_TOKEN }} | |
| run: pnpm install | |
| - run: pnpm run build | |
| - name: Release | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_WRITE_NPM_TOKEN }} | |
| run: pnpm -r publish --no-git-checks | |
| tag: | |
| needs: release | |
| if: success() | |
| runs-on: ${{ vars.NOL_RUNNER }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get released version | |
| run: echo "TAG_NAME=v$(cat ./lerna.json | jq -r '.version')" >> $GITHUB_ENV | |
| - name: Create tag object | |
| id: create-tag-object | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#create-a-tag-object | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/tags \ | |
| -f \ | |
| --request POST \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"tag\":\"$TAG_NAME\",\"message\":\"released at \`${{ github.event.updated_at }}\`\",\"object\":\"${GITHUB_SHA}\",\"type\":\"commit\"}" \ | |
| > tag.json | |
| echo "::set-output name=tag-sha::$(node -p -e 'require(`./tag.json`).sha')" | |
| - name: Check tag ref exist | |
| id: check-tag-ref | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#get-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs/tags/$TAG_NAME \ | |
| -sI \ | |
| -o /dev/null \ | |
| -w "%{http_code}" \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| > status | |
| echo "::set-output name=status::$(cat status)" | |
| - name: Create new tag ref | |
| if: ${{ steps.check-tag-ref.outputs.status != '200' }} | |
| env: | |
| TAG_SHA: ${{ steps.create-tag-object.outputs.tag-sha }} | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#create-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs \ | |
| -f \ | |
| --request POST \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"ref\":\"refs/tags/$TAG_NAME\",\"sha\":\"$TAG_SHA\"}" | |
| - name: Update tag ref | |
| if: ${{ steps.check-tag-ref.outputs.status == '200' }} | |
| env: | |
| TAG_SHA: ${{ steps.create-tag-object.outputs.tag-sha }} | |
| # https://docs.github.com/en/free-pro-team@latest/rest/reference/git#update-a-reference | |
| run: | | |
| curl --url $GITHUB_API_URL_BASE/git/refs/tags/$TAG_NAME \ | |
| -f \ | |
| --request PATCH \ | |
| -H 'Authorization: token ${{ secrets.TRIPLE_BOT_GITHUB_TOKEN }}' \ | |
| -H 'Content-Type: application/json' \ | |
| -d "{\"force\":true,\"sha\":\"${TAG_SHA}\"}" | |
| canary-release: | |
| needs: wait-for-ci | |
| if: startsWith(github.event.ref, 'refs/tags/release-pr-') | |
| runs-on: ${{ vars.NOL_RUNNER }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v3 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| registry-url: ${{ env.NPM_REGISTRY_URL }} | |
| # cache: 'pnpm' | |
| - name: Get release version | |
| env: | |
| TAG_NAME: ${{ github.event.ref }} | |
| run: | | |
| NEXT_VERSION=$(node -e "const [major, minor, patch] = require('./lerna.json').version.split('.');console.log(['v'+major, minor, parseInt(patch, 10) + 1].join('.'))") | |
| PR_NUMBER=${TAG_NAME:21} # refs/tags/release-pr-<num>에서 <num>만 추출 | |
| REF_COUNT=$(node -p -e "Math.max(0, parseInt((\"$(git describe --always --long --dirty --match "v*.*.*")\".match(/^(?:.*@)?.*-(\d+)-.*?$/) || ['0', '0'])[1], 10) - 1)") | |
| echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV | |
| echo "DEPLOY_VERSION=$NEXT_VERSION-pr-$PR_NUMBER.$REF_COUNT" >> $GITHUB_ENV | |
| - name: Install dependencies | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_ONLY_NPM_TOKEN }} | |
| run: pnpm install | |
| - run: pnpm run build | |
| - run: | | |
| pnpm exec lerna version $DEPLOY_VERSION \ | |
| --amend \ | |
| --force-publish \ | |
| --ignore-scripts \ | |
| --no-git-tag-version \ | |
| --preid "pr-$PR_NUMBER" \ | |
| --yes | |
| - name: Publish as canary | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READ_WRITE_NPM_TOKEN }} | |
| run: pnpm -r publish --tag canary --no-git-checks | |
| - name: Notify released version on pull request | |
| run: | | |
| curl \ | |
| --url $GITHUB_API_URL_BASE/issues/${{ env.PR_NUMBER }}/comments \ | |
| -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Content-Type: application/json" \ | |
| -f --request POST \ | |
| -d "{\"body\":\"${{ env.DEPLOY_VERSION }} has been published!\"}" |