[READ-ONLY] Mirror of https://github.com/bombshell-dev/automation. GitHub Actions for the Bombshell organization
ci
0

Configure Feed

Select the types of activity you want to include in your feed.

add: tsdown workflow

Paul Valladares (Apr 28, 2025, 8:30 AM -0600) 60aea19f 2a11ace5

+93
+50
.github/workflows/tsdown.yml
··· 1 + name: tsdown 2 + 3 + on: 4 + push: 5 + branches: [ main ] 6 + pull_request: 7 + branches: [ main ] 8 + 9 + jobs: 10 + build: 11 + runs-on: ubuntu-latest 12 + steps: 13 + - uses: actions/checkout@v4 14 + 15 + - name: Setup Node.js 16 + uses: actions/setup-node@v4 17 + with: 18 + node-version: '20' 19 + cache: 'npm' 20 + 21 + - name: Generate tsdown config 22 + run: | 23 + cat > tsdown.config.ts << 'EOL' 24 + import { defineConfig } from 'tsdown' 25 + 26 + export default defineConfig({ 27 + entry: ['./src'], 28 + format: ['esm'], 29 + clean: true, 30 + dts: true, 31 + minify: true, 32 + sourcemap: true, 33 + external: [], 34 + platform: 'node', 35 + treeshake: true 36 + }) 37 + EOL 38 + 39 + - name: Install tsdown and types 40 + run: npm install --save-dev tsdown @types/node 41 + 42 + - name: Build with tsdown 43 + run: npx tsdown build 44 + 45 + - name: Upload build artifacts 46 + uses: actions/upload-artifact@v4 47 + with: 48 + name: dist 49 + path: dist/ 50 + retention-days: 5
+43
README.md
··· 25 25 DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_MERGEBOT }} 26 26 ``` 27 27 28 + ## tsdown 29 + 30 + This workflow provides a standardized build process for TypeScript libraries using tsdown. It includes: 31 + 32 + - Automatic building on push and pull requests 33 + - Node.js setup with caching 34 + - Automatic tsdown configuration generation 35 + - Build artifact uploads 36 + 37 + ### Usage 38 + 39 + Add the following to your repository's workflow: 40 + 41 + ```yml 42 + name: Build 43 + 44 + on: 45 + push: 46 + branches: [main] 47 + pull_request: 48 + branches: [main] 49 + 50 + jobs: 51 + build: 52 + uses: bombshell-dev/automation/.github/workflows/tsdown.yml@main 53 + ``` 54 + 55 + The workflow will automatically: 56 + 1. Generate a standard tsdown configuration 57 + 2. Install necessary dependencies (tsdown and @types/node) 58 + 3. Build your TypeScript project 59 + 4. Upload the build artifacts 60 + 61 + The generated configuration includes: 62 + - ESM output format 63 + - TypeScript declaration file generation 64 + - Source maps 65 + - Minification 66 + - Node.js platform targeting 67 + - Tree shaking optimization 68 + 69 + If you need to customize the configuration, you can create your own `tsdown.config.ts` file in your project root, and the workflow will use that instead of generating one. 70 + 28 71 ## Acknowledgements 29 72 30 73 This repository borrows heavily from [`withastro/automation`](https://github.com/withastro/automation), published under the MIT License&mdash;Copyright (c) 2023 Astro.