deploy #140
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
release: | |
types: [ created ] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
deploy: | |
name: deploy release assets | |
strategy: | |
matrix: | |
include: | |
- node-version: 22.x | |
os: ubuntu-latest | |
python-version: '3.x' | |
asset-name: linux-x86_64.tar.gz | |
pkg-dir: pkg/linux | |
bin-file: ./pkg/linux/index | |
make-args: --make-args="-j4" | |
zip-cmd: cd ./pkg/linux && tar -cvzf linux-x86_64.tar.gz LICENSE README.md README.ja.md index && cd ../../ | |
zip-mime: application/gzip | |
- node-version: 22.x | |
os: macos-latest | |
python-version: '3.x' | |
asset-name: macos.tar.gz | |
pkg-dir: pkg/macos | |
bin-file: ./pkg/macos/index | |
make-args: --make-args="-j4" | |
zip-cmd: cd ./pkg/macos && tar -cvzf macos.tar.gz LICENSE README.md README.ja.md index && cd ../../ | |
zip-mime: application/gzip | |
- node-version: 22.x | |
os: windows-latest | |
python-version: '3.x' | |
asset-name: win64.zip | |
pkg-dir: pkg/win | |
bin-file: ./pkg/win/index.exe | |
make-args: --make-args="vs2022" | |
zip-cmd: npm run zip-jszip -- -o ./pkg/win/win64.zip ./pkg/win/LICENSE ./pkg/win/README.md ./pkg/win/README.ja.md ./pkg/win/index.exe | |
zip-mime: application/zip | |
runs-on: ${{ matrix.os }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: set up nasm | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: choco install nasm | |
- name: set up developer command prompt | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
check-latest: true | |
node-version: ${{ matrix.node-version }} | |
- name: install dependencies | |
run: npm install | |
- name: prepare build | |
run: npm run prebuild | |
- name: make directories | |
run: mkdir -p ./{bundle,${{ matrix.pkg-dir }}} | |
- name: build binary | |
run: | | |
npm run bundle-js | |
npm run bundle-bin -- -t ${{ matrix.bin-file }} ${{ matrix.make-args }} | |
- name: verify binary | |
run: stat ${{ matrix.bin-file }} | |
- name: zip package | |
run: | | |
cp ./LICENSE ./README.md ./README.ja.md ./${{ matrix.pkg-dir }} | |
${{ matrix.zip-cmd }} | |
stat ./${{ matrix.pkg-dir}}/${{ matrix.asset-name }} | |
- name: upload release asset | |
uses: shogo82148/actions-upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ matrix.pkg-dir}}/${{ matrix.asset-name }} | |
asset_name: ${{ matrix.asset-name }} | |
asset_content_type: ${{ matrix.zip-mime }} |