|
1 | 1 | name: Publish Release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + # Release |
4 | 5 | release: |
5 | 6 | types: [released] |
| 7 | + # Nightly |
| 8 | + workflow_dispatch: |
| 9 | + schedule: |
| 10 | + - cron: "0 0 * * *" |
| 11 | + |
| 12 | +run-name: >- |
| 13 | + ${{ |
| 14 | + github.event_name == 'release' && 'Publish Release' |
| 15 | + || (github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') && 'Next Publication' |
| 16 | + || 'Publish Release' }} |
6 | 17 |
|
7 | 18 | jobs: |
8 | 19 | publish: |
9 | | - runs-on: ubuntu-20.04 |
10 | | - |
| 20 | + if: github.event_name == 'release' |
| 21 | + runs-on: ubuntu-latest |
| 22 | + environment: release |
| 23 | + permissions: |
| 24 | + contents: read |
| 25 | + id-token: write |
11 | 26 | steps: |
12 | 27 | - name: Checkout |
13 | | - uses: actions/checkout@v3 |
14 | | - - uses: actions/setup-node@v3 |
| 28 | + uses: actions/checkout@v5 |
| 29 | + - uses: actions/setup-node@v6 |
15 | 30 | with: |
16 | | - node-version: '18.x' |
| 31 | + node-version: '24' |
17 | 32 | registry-url: 'https://registry.npmjs.org' |
18 | | - - run: npm install -g npm |
| 33 | + - name: Install OS dependencies |
| 34 | + run: | |
| 35 | + sudo apt-get update |
| 36 | + # Required for USB functionality |
| 37 | + sudo apt-get install -y libusb-1.0-0-dev |
| 38 | + # Required for Linux udev/device detection |
| 39 | + sudo apt-get install -y libudev-dev |
19 | 40 | - name: Install Dependencies |
20 | 41 | run: npm ci |
21 | 42 | - name: Build |
22 | 43 | run: npm run build |
23 | | - - name: Set up npm |
24 | | - run: printf '%s\n' '//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' registry=https://registry.npmjs.org/ always-auth=true >> .npmrc |
25 | 44 | - name: Publish |
26 | 45 | run: npm publish --access public |
27 | 46 | env: |
28 | | - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 47 | + NPM_CONFIG_PROVENANCE: 'true' |
| 48 | + |
| 49 | + publish-nightly: |
| 50 | + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' |
| 51 | + runs-on: ubuntu-latest |
| 52 | + environment: release |
| 53 | + permissions: |
| 54 | + contents: read |
| 55 | + id-token: write |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v5 |
| 59 | + - uses: actions/setup-node@v6 |
| 60 | + with: |
| 61 | + node-version: '24' |
| 62 | + registry-url: 'https://registry.npmjs.org' |
| 63 | + - name: Install OS dependencies |
| 64 | + run: | |
| 65 | + sudo apt-get update |
| 66 | + # Required for USB functionality |
| 67 | + sudo apt-get install -y libusb-1.0-0-dev |
| 68 | + # Required for Linux udev/device detection |
| 69 | + sudo apt-get install -y libudev-dev |
| 70 | + - name: Package next |
| 71 | + run: ./scripts/package-next |
| 72 | + - name: Publish |
| 73 | + run: npm publish --provenance --tag next |
| 74 | + env: |
| 75 | + NPM_CONFIG_PROVENANCE: 'true' |
0 commit comments