name: Release Packages on: push: tags: - 'v*' workflow_call: inputs: version: required: true description: Version type: string tag: description: NPM tag default: 'latest' type: string permissions: id-token: write # Required for OIDC contents: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} jobs: prepare: if: github.repository == 'lucide-icons/lucide' && contains('["ericfennis", "karsa-mistmere", "jguddas"]', 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: prepare permissions: id-token: write # Required for OIDC contents: read strategy: fail-fast: false matrix: package: [ 'lucide', 'lucide-react', 'lucide-react-native', 'lucide-preact', 'lucide-solid', '@lucide/angular', '@lucide/astro', '@lucide/icons', '@lucide/svelte', '@lucide/vue', ] steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v6 with: cache: 'pnpm' node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Set new version run: pnpm --fail-if-no-match --filter ${{ matrix.package }} version --new-version ${{ needs.prepare.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 --access public --no-git-checks --ignore-scripts --tag ${{ inputs.tag }} env: NPM_CONFIG_PROVENANCE: true lucide-static: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: [prepare, lucide-font] permissions: id-token: write # Required for OIDC contents: read steps: - uses: actions/checkout@v6 - uses: actions/download-artifact@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v6 with: cache: 'pnpm' node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Set new version run: pnpm --filter lucide-static version --new-version ${{ needs.prepare.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 --ignore-scripts --tag ${{ inputs.tag }} --access public env: NPM_CONFIG_PROVENANCE: true lucide-font: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: prepare steps: - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v6 with: cache: 'pnpm' node-version-file: 'package.json' - name: Install dependencies run: pnpm install --frozen-lockfile - name: Execute unit tests for build-font run: pnpm test:font - name: Create font in ./lucide-font run: pnpm build:font --saveCodePoints env: BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }} - name: 'Upload to Artifacts' uses: actions/upload-artifact@v4 with: name: lucide-font path: lucide-font post-release: if: github.repository == 'lucide-icons/lucide' && github.event_name != 'workflow_call' runs-on: ubuntu-latest needs: [prepare, lucide-font] permissions: id-token: write # Required for OIDC contents: write steps: - uses: actions/checkout@v6 - uses: actions/download-artifact@v4 - name: Zip font and icons run: | zip -r lucide-font-${{ needs.prepare.outputs.VERSION }}.zip lucide-font zip -r lucide-icons-${{ needs.prepare.outputs.VERSION }}.zip icons - name: Release zip and fonts uses: softprops/action-gh-release@v2 with: tag_name: ${{ needs.prepare.outputs.VERSION }} files: | lucide-font-${{ needs.prepare.outputs.VERSION }}.zip lucide-icons-${{ needs.prepare.outputs.VERSION }}.zip