Skip to content

Commit

Permalink
ci: upload iife and iife ti artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
impart我的impart committed Mar 8, 2024
1 parent 15cddef commit 6f5fb99
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,31 @@ jobs:
name: engine-chronocat-event-${{ github.sha }}
path: build/dist/engine-chronocat-event

- name: Upload IIFE
uses: actions/upload-artifact@v3
with:
name: chronocat-iife-${{ github.sha }}
path: build/dist/iife

- name: Build IIFE-TI
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
env:
TI_KEY: ${{ secrets.TI_KEY }}
run: |
mkdir -p build/dist/iife-ti
echo "$TI_KEY" > $RUNNER_TEMP/ti.pem
openssl dgst -sha256 -sign $RUNNER_TEMP/ti.pem -keyform PEM -out build/dist/iife-ti/chronocat.js.ti.bin -binary build/dist/iife/chronocat.js
rm $RUNNER_TEMP/ti.pem
cat build/dist/iife/chronocat.js >> build/dist/iife-ti/chronocat.js.ti.bin
shell: bash

- name: Upload IIFE-TI
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: chronocat-iife-ti-${{ github.sha }}
path: build/dist/iife-ti/chronocat.js.ti.bin

- name: Upload Build Metadata
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion packages/iife/pack.cts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ void (async () => {
'../../build/dist/iife/',
)
await mkdir(distPath, { recursive: true })
await cp(join(__dirname, 'lib/index.js'), join(distPath, 'main.js'))
await cp(join(__dirname, 'lib/index.js'), join(distPath, 'chronocat.js'))
})()

0 comments on commit 6f5fb99

Please sign in to comment.