From 78ca7d6b2a22ac6677881b293d75446f055d7aa6 Mon Sep 17 00:00:00 2001 From: TheStanish Date: Thu, 8 Jun 2023 11:25:23 -0400 Subject: [PATCH] 1.3.6 test --- .github/workflows/build.yaml | 37 ++++++++++++++++++++++-------------- index.html | 2 +- package.json | 2 +- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6f03460..0868989 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,7 @@ name: Build and Release run-name: ${{ github.actor }} is building and releasing the latest version + on: push: branches: @@ -19,9 +20,6 @@ jobs: with: node-version: '18' - - name: Clear npm cache - run: npm cache clean --force - - name: Install dependencies env: NODE_ENV: development @@ -32,16 +30,14 @@ jobs: run: echo "::set-output name=version::$(node -p "require('./package.json').version")" - name: Build project - run: npm run build + run: npm run make - name: Find latest asset id: find_latest_asset run: | - asset_path=$(find ./out/make -name "*.zip" -type f -printf "%T@ %p\n" | sort -k1nr | head -n1 | awk '{print $2}') + asset_path=$(ls -t ./out/make/*.*.*.zip | head -n1) echo "::set-output name=asset_path::$asset_path" - - - name: Create Release id: create_release uses: actions/create-release@v1 @@ -54,16 +50,29 @@ jobs: prerelease: false - name: Upload Release Asset - id: upload_asset - uses: actions/upload-release-asset@v1 + uses: actions/github-script@v4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - 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 + 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, + }); - name: Publish Release run: | @@ -72,4 +81,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}' + -d '{"draft": false}' \ No newline at end of file diff --git a/index.html b/index.html index 6b6c498..b32d87c 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@

Hello Hoseki! Meh

-

Welcome to your Electron application v1.3.5

+

Welcome to your Electron application v1.3.6

First paragraph

Second paragraph

Third paragraph

diff --git a/package.json b/package.json index 6027d45..f9fd2f7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hoseki-admin", "productName": "hoseki-admin", - "version": "1.3.5", + "version": "1.3.6", "description": "Hoseki admin app test", "main": ".vite/build/main.js", "scripts": {