Skip to content

Commit

Permalink
chore: pkg workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyg603 committed Mar 20, 2024
1 parent d1e5e54 commit 7a52ab2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 8 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Upload Artifacts for Multiple OS

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
run_script: pkg:linux
artifact_name: symbol-upload-linux
- os: macos-latest
run_script: pkg:macos
artifact_name: symbol-upload-macos
- os: windows-latest
run_script: pkg:win
artifact_name: symbol-upload-win

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Run platform-specific script
run: npm run ${{ matrix.run_script }} # Executes the script based on the operating system

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: pkg/* # Uploads the artifact with a platform-specific name and path
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
"build": "tsc",
"prerelease": "npm run build",
"release": "npm publish --access public",
"prepkg": "npm run build",
"pkg": "npx pkg package.json",
"prepkg:linux": "npm run build",
"pkg:linux": "npx pkg package.json --targets node18-linux-x64 --output ./pkg/symbol-upload-linux",
"prepkg:macos": "npm run build",
"pkg:macos": "npx pkg package.json --targets node18-macos-x64 --output ./pkg/symbol-upload-macos",
"prepkg:windows": "npm run build",
"pkg:windows": "npx pkg package.json --targets node18-win-x64 --output ./pkg/symbol-upload-windows",
"act": "act --secret-file .env"
},
"repository": {
Expand All @@ -48,12 +52,6 @@
"homepage": "https://github.com/BugSplat-Git/symbol-upload#readme",
"pkg": {
"scripts": "./dist/**/*.js",
"targets": [
"node18-macos-x64",
"node18-linux-x64",
"node18-win-x64"
],
"outputPath": "./pkg",
"compress": "GZip",
"assets": [
"package.json",
Expand Down

0 comments on commit 7a52ab2

Please sign in to comment.