diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0868989..d20a9bb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,7 +1,6 @@ name: Build and Release run-name: ${{ github.actor }} is building and releasing the latest version - on: push: branches: @@ -20,6 +19,9 @@ jobs: with: node-version: '18' + - name: Clear npm cache + run: npm cache clean --force + - name: Install dependencies env: NODE_ENV: development @@ -30,12 +32,12 @@ jobs: run: echo "::set-output name=version::$(node -p "require('./package.json').version")" - name: Build project - run: npm run make + run: npm run build - name: Find latest asset id: find_latest_asset run: | - asset_path=$(ls -t ./out/make/*.*.*.zip | head -n1) + asset_path=$(pwd)/out/make/*.*.*.zip echo "::set-output name=asset_path::$asset_path" - name: Create Release @@ -50,29 +52,15 @@ jobs: prerelease: false - name: Upload Release Asset - uses: actions/github-script@v4 + id: upload_asset + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - script: | - const fs = require('fs'); - const path = require('path'); - const assetPath = '${{ steps.find_latest_asset.outputs.asset_path }}'; - const assetName = 'hoseki-admin.zip'; - const assetContentType = 'application/zip'; - const octokit = github.getOctokit('${{ secrets.GITHUB_TOKEN }}'); - const releaseId = '${{ steps.create_release.outputs.id }}'; - - const uploadUrl = `https://uploads.github.com/repos/${{ github.repository }}/releases/${releaseId}/assets?name=${encodeURIComponent(assetName)}`; - const assetData = fs.readFileSync(path.resolve(assetPath)); - await octokit.request(uploadUrl, { - method: 'POST', - headers: { - 'Content-Type': assetContentType, - 'Content-Length': assetData.length, - }, - data: assetData, - }); + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ steps.find_latest_asset.outputs.asset_path }} + asset_name: hoseki-admin.zip + asset_content_type: application/zip - name: Publish Release run: | @@ -81,4 +69,4 @@ jobs: -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }} \ - -d '{"draft": false}' \ No newline at end of file + -d '{"draft": false}' diff --git a/index.html b/index.html index b32d87c..9e21c4b 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@
Welcome to your Electron application v1.3.6
+Welcome to your Electron application v1.3.7
First paragraph
Second paragraph
Third paragraph
diff --git a/package.json b/package.json index f9fd2f7..9010b4a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hoseki-admin", "productName": "hoseki-admin", - "version": "1.3.6", + "version": "1.3.7", "description": "Hoseki admin app test", "main": ".vite/build/main.js", "scripts": {