From 08b5538e498256ebf2c91c0943b8417b30af7733 Mon Sep 17 00:00:00 2001 From: jung-geun Date: Wed, 18 Dec 2024 03:43:47 +0900 Subject: [PATCH] =?UTF-8?q?GitHub=20Actions=20=EC=9B=8C=ED=81=AC=ED=94=8C?= =?UTF-8?q?=EB=A1=9C=EC=9A=B0=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8:=20?= =?UTF-8?q?=EB=B9=8C=EB=93=9C=20=ED=94=84=EB=A1=9C=EC=84=B8=EC=8A=A4=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=EB=A6=B4=EB=A6=AC=EC=8A=A4=20?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20package.json=EC=9D=98=20=EC=A7=84=EC=9E=85?= =?UTF-8?q?=EC=A0=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 43 --------------------- .github/workflows/release.yml | 62 ++++++++++++++++++++++++++++++ nfd2nfc/{normalize.js => index.js} | 0 nfd2nfc/package.json | 2 +- 4 files changed, 63 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yml rename nfd2nfc/{normalize.js => index.js} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index a368505..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Build and Package - -on: - push: - branches: - - main - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Install dependencies - run: npm install - - - name: Build package - run: npm run build - - - name: Build with pkg - run: npx pkg . - - - name: Build .app file - run: | - npm install electron-packager --save-dev - npx electron-packager . MyApp --platform=darwin --arch=arm64,x64 --out=release-builds - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: build-artifacts - path: | - *.exe - *.app - release-builds/** \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d270f54 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,62 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build-and-release: + runs-on: macos-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + + - name: Install dependencies and build nfd2nfc + run: | + cd nfd2nfc + npm install + npm run build + + - name: Install dependencies and build MACOS-APP + run: | + cd MACOS-APP + npm install + npm run build + + - name: Upload NFD2NFC executable + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./nfd2nfc/dist/NFD2NFC-$(uname -s).zip + asset_name: NFD2NFC-$(uname -s).zip + asset_content_type: application/zip + + - name: Upload MacOS .app + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./MACOS-APP/dist/*.app.zip + asset_name: MacApp.zip + asset_content_type: application/zip + + - name: Upload MacOS .dmg + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./MACOS-APP/dist/*.dmg + asset_name: MacApp.dmg + asset_content_type: application/octet-stream diff --git a/nfd2nfc/normalize.js b/nfd2nfc/index.js similarity index 100% rename from nfd2nfc/normalize.js rename to nfd2nfc/index.js diff --git a/nfd2nfc/package.json b/nfd2nfc/package.json index 9078c41..193fc11 100644 --- a/nfd2nfc/package.json +++ b/nfd2nfc/package.json @@ -1,7 +1,7 @@ { "name": "@pieroot/nfd2nfc", "version": "1.0.0", - "main": "main.js", + "main": "index.js", "description": "Convert NFD to NFC", "dependencies": { "cli-progress": "^3.12.0",