Skip to content

fix card clse redirect url #67

fix card clse redirect url

fix card clse redirect url #67

Workflow file for this run

name: Publish Itthynk Components
on:
push:
tags:
- itthynk-components@*.*.*
pull_request:
types: [closed]
branches:
- publish
paths:
- 'components/**'
permissions:
contents: write
packages: write
pull-requests: write
id-token: write
jobs:
release-version:
name: Release Version
runs-on: ubuntu-latest
environment: publish
env:
RELEASE_NAME: components
RELEASE_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
GLOBAL_GPG_SECRET: ${{ secrets.GLOBAL_GPG_SECRET }}
GLOBAL_GPG_PASSPHRASE: ${{ secrets.GLOBAL_GPG_PASSPHRASE }}
if: github.event_name == 'pull_request' && github.event.pull_request.merged==true
outputs:
release_version: ${{ steps.release_trigger.outputs.release_version }}
pr_log: ${{ steps.release_trigger.outputs.pr_log }}
release_sha: ${{ steps.release_trigger_sha.outputs.release_sha }}
steps:
- uses: actions/[email protected]
- name: setup node
id: release_trigger
uses: mitch1009/[email protected]
with:
git_user_email: ${{env.GIT_USER_EMAIL}}
git_username: ${{env.GIT_USERNAME }}
gpg_private_key: ${{env.GLOBAL_GPG_SECRET}}
gpg_passphrase: ${{env.GLOBAL_GPG_PASSPHRASE}}
git_token: ${{env.GIT_TOKEN}}
bump_script: "rel:patch"
working_directory: "components"
release_branch: publish
version_file_path: "components/package.json"
- name: Release Trigger
id: release_trigger_sha
run: |
SHA=$(git rev-parse --short HEAD)
echo "release_sha=${SHA}" >> $GITHUB_OUTPUT
publish-npm:
needs: release-version
runs-on: ubuntu-latest
environment: publish
name: Publish to npm
if: needs.release-version.outputs.release_version != ''
steps:
- uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
scope: '@opherlabs'
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/[email protected]
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
working-directory: ./components
run: |
# replace the version in package.json with the release version
node -e "const fs = require('fs'); const packageJson = require('./package.json'); packageJson.version = '${{ needs.release-version.outputs.release_version }}'; fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));"
npm run build
- name: Publish to npm
working-directory: ./components
run: npm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-github:
needs: release-version
runs-on: ubuntu-latest
environment: publish
if: needs.release-version.outputs.release_version != ''
name: Publish to GitHub Packages
steps:
- uses: actions/[email protected]
- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
scope: '@opherlabs'
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/[email protected]
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
working-directory: ./components
run: |
# replace the version in package.json with the release version
node -e "const fs = require('fs'); const packageJson = require('./package.json'); packageJson.version = '${{ needs.release-version.outputs.release_version }}'; fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));"
npm run build
- name: Publish to GitHub Packages
working-directory: ./components
run: npm publish --no-git-checks --registry https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GIT_TOKEN }}
tag-release:
name: Tag Release πŸŽ‰
runs-on: ubuntu-latest
environment: publish
needs: [publish-github]
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Generate Release Notes
run: |
echo "RELEASE_VERSION=$(cat components/package.json | jq -r .version)"
create-new-release:
name: Create New Release πŸŽ‰
runs-on: ubuntu-latest
environment: publish
needs: [release-version,publish-npm, tag-release]
if: needs.release-version.outputs.release_version != ''
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Get contributors
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
CONTRIBUTORS=$(gh api repos/${{ github.repository }}/contributors --jq 'map(.login) | join(", @")')
echo "CONTRIBUTORS=@$CONTRIBUTORS" >> $GITHUB_ENV
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
gh release create itthynk-components@${{ needs.release-version.outputs.release_version }} \
--title "itthynk-components@${{ needs.release-version.outputs.release_version }}" \
--notes "## 🎍 What's new in this release:
${{ needs.release-version.outputs.pr_log }}
## πŸ™πŸΎ Thank You:
A big thank you to all our amazing engineers and maintainers
"