Skip to content

try: exclude github dir from uploading (#232) #40

try: exclude github dir from uploading (#232)

try: exclude github dir from uploading (#232) #40

Workflow file for this run

name: Publish to NPM
on:
push:
tags:
- '*'
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Extract Version
id: extract_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.11.0
- name: Download & Build Icons
run: npm ci --progress=false && npm run line:build && npm run solid:build && npm run thinline:build && npm run monochrome:build
env:
CI_COMMIT_REF_NAME: ${{ steps.extract_version.outputs.VERSION }}
API_DOWNLOAD_LINE: ${{ secrets.API_DOWNLOAD_LINE }}
API_DOWNLOAD_SOLID: ${{ secrets.API_DOWNLOAD_SOLID }}
API_DOWNLOAD_THINLINE: ${{ secrets.API_DOWNLOAD_THINLINE }}
API_DOWNLOAD_MONOCHROME: ${{ secrets.API_DOWNLOAD_MONOCHROME }}
RELEASE_DIR: 'release'
- name: Publish to CDN
uses: jakejarvis/s3-sync-action@master
with:
args: --no-progress --exclude '.git/*' --exclude 'node_modules/*' --exclude 'build/*' --exclude '.github/*' --exclude 'github/*'
env:
AWS_S3_BUCKET: 'unicons-iconscout-a5996f0'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEST_DIR: 'release/${{ steps.extract_version.outputs.VERSION }}'
- uses: actions/setup-node@v4
with:
node-version: 22.11.0
- name: Publish to NPM
run: printf "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc && npm publish --access=public
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract_version.outputs.VERSION }}
release_name: Release ${{ steps.extract_version.outputs.VERSION }}
draft: true
prerelease: false