Release Packages #361
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: Release Packages | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_call: | |
inputs: | |
version: | |
required: true | |
description: Version | |
type: string | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version | |
required: true | |
jobs: | |
pre-release: | |
if: github.repository == 'lucide-icons/lucide' && contains('["ericfennis", "karsa-mistmere"]', github.actor) | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- name: Get the version | |
id: get_version | |
run: | | |
echo $VERSION_REF | |
echo "VERSION=${VERSION_REF/refs\/tags\/\v}" >> $GITHUB_OUTPUT | |
env: | |
VERSION_REF: ${{ inputs.version || github.event.inputs.version || github.ref }} | |
release: | |
if: github.repository == 'lucide-icons/lucide' | |
runs-on: ubuntu-latest | |
needs: pre-release | |
strategy: | |
matrix: | |
package: [ | |
'lucide', | |
'lucide-react', | |
'lucide-react-native', | |
'lucide-vue', | |
'lucide-vue-next', | |
'lucide-angular', | |
'lucide-preact', | |
'lucide-solid', | |
'lucide-svelte', | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
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 --frozen-lockfile | |
- name: Set Auth Token | |
run: npm config set //registry.npmjs.org/:_authToken ${{ inputs.NPM_TOKEN || secrets.NPM_TOKEN }} | |
- name: Set new version | |
run: pnpm --filter ${{ matrix.package }} version --new-version ${{ needs.pre-release.outputs.VERSION }} --no-git-tag-version | |
- name: Build | |
run: pnpm --filter ${{ matrix.package }} build | |
- name: Test | |
run: pnpm --filter ${{ matrix.package }} test | |
- name: Publish | |
run: pnpm --filter ${{ matrix.package }} publish --no-git-checks --ignore-scripts | |
lucide-static: | |
if: github.repository == 'lucide-icons/lucide' | |
runs-on: ubuntu-latest | |
needs: [pre-release, lucide-font] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
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 --frozen-lockfile | |
- name: Set Auth Token | |
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | |
- name: Set new version | |
run: pnpm --filter lucide-static version --new-version ${{ needs.pre-release.outputs.VERSION }} --no-git-tag-version | |
- name: Move Font | |
run: cp -r lucide-font packages/lucide-static/font | |
- name: Build | |
run: pnpm --filter lucide-static build | |
- name: Publish | |
run: pnpm --filter lucide-static publish --no-git-checks | |
lucide-font: | |
if: github.repository == 'lucide-icons/lucide' | |
runs-on: ubuntu-latest | |
needs: pre-release | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3.4.1 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v2.0.1 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
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 --filter outline-svg | |
- name: Outline svg Icons | |
run: pnpm build:outline-icons | |
- name: Install dependencies | |
run: pnpm install --filter build-font | |
- name: Create font in ./lucide-font | |
run: pnpm build:font | |
- name: "Upload to Artifacts" | |
uses: actions/upload-artifact@v1 | |
with: | |
name: lucide-font | |
path: lucide-font | |
post-release: | |
if: github.repository == 'lucide-icons/lucide' | |
runs-on: ubuntu-latest | |
needs: [ | |
pre-release, | |
lucide-font, | |
] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v2 | |
- name: Zip font and icons | |
run: | | |
zip -r lucide-font-${{ needs.pre-release.outputs.VERSION }}.zip lucide-font | |
zip -r lucide-icons-${{ needs.pre-release.outputs.VERSION }}.zip icons | |
- name: Release zip and fonts | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ needs.pre-release.outputs.VERSION }} | |
files: | | |
lucide-font-${{ needs.pre-release.outputs.VERSION }}.zip | |
lucide-icons-${{ needs.pre-release.outputs.VERSION }}.zip |