Release 18/12/2024 (#263) #231
This file contains 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: publish-release | |
on: | |
push: | |
branches: | |
- master | |
- "!dependabot/**/**" | |
paths-ignore: | |
- "**/package.json" | |
- ".yarn/versions/**" | |
jobs: | |
publish-packages-npm: | |
runs-on: ubuntu-latest | |
timeout-minutes: 18 | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set Node version | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "yarn" | |
- name: Cache NPM dependencies | |
uses: actions/cache@v3 | |
id: cache-dependencies | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
run: yarn | |
- name: Create .env file | |
uses: DeveloperRic/[email protected] | |
with: | |
full_text: | | |
GITHUB_TOKEN=${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }} | |
include_env_vars: true | |
- name: Publish packages | |
run: | | |
export NODE_OPTIONS="--max_old_space_size=8192" | |
yarn publish:stable | |
env: | |
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_PUBLISH }} | |
- name: Branch protection OFF | |
run: | | |
curl --request PUT \ | |
--url 'https://api.github.com/repos/tiendanube/nimbus-design-system/branches/master/protection' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }}' \ | |
--data '{"enforce_admins":false,"required_pull_request_reviews":null,"required_status_checks":null,"required_conversation_resolution":false,"restrictions":null,"required_linear_history":false}' | |
- name: Commit release | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "feat: publish release" | |
- name: Branch protection ON | |
run: | | |
curl --request PUT \ | |
--url 'https://api.github.com/repos/tiendanube/nimbus-design-system/branches/master/protection' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }}' \ | |
--header 'Accept: application/vnd.github.luke-cage-preview+json' \ | |
--data '{"enforce_admins":true,"required_pull_request_reviews":{"dismiss_stale_reviews":true,"require_code_owner_reviews":true,"required_approving_review_count":1},"required_conversation_resolution":true,"required_status_checks":null,"restrictions":null,"required_linear_history":true}' | |
trigger-action-create-github-tag: | |
runs-on: ubuntu-latest | |
needs: publish-packages-npm | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Trigger github action create github tag | |
run: | | |
curl --request POST \ | |
--url 'https://api.github.com/repos/tiendanube/nimbus-design-system/actions/workflows/58856079/dispatches' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }}' \ | |
--data '{"ref":"master"}' | |
trigger-action-send-slack-notifications: | |
needs: [publish-packages-npm, trigger-action-create-github-tag] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Trigger github action send slack notifications | |
run: | | |
curl --request POST \ | |
--url 'https://api.github.com/repos/tiendanube/nimbus-design-system/actions/workflows/58847410/dispatches' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }}' \ | |
--data '{"ref":"master"}' | |
trigger-action-update-generate-documentation: | |
needs: | |
[ | |
publish-packages-npm, | |
trigger-action-create-github-tag, | |
trigger-action-send-slack-notifications, | |
] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Trigger github action update documentation | |
run: | | |
curl --request POST \ | |
--url 'https://api.github.com/repos/tiendanube/nimbus-design-system/actions/workflows/51785513/dispatches' \ | |
--header 'Authorization: token ${{ secrets.PAT_CHANGE_BRANCH_PROTECTION_RULES_FROM_USER_NIMBUS }}' \ | |
--data '{"ref":"master"}' |