Skip to content

Commit

Permalink
1.3.7 test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheStanish committed Jun 8, 2023
1 parent 78ca7d6 commit 9c6f877
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 26 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build and Release
run-name: ${{ github.actor }} is building and releasing the latest version


on:
push:
branches:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand All @@ -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}'
-d '{"draft": false}'
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<div class="no-drag">
<h1 class="main-msg">Hello Hoseki! Meh</h1>
<p>Welcome to your Electron application v1.3.6</p>
<p>Welcome to your Electron application v1.3.7</p>
<p id="p1">First paragraph</p>
<p id="p2">Second paragraph</p>
<p id="p3">Third paragraph</p>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 9c6f877

Please sign in to comment.