Skip to content

Commit

Permalink
feat: added a workflow for build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
andreyxdd committed Oct 21, 2023
1 parent edd0346 commit 0eabd9d
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 9 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and release

on: push

concurrency:
group: build-and-release
cancel-in-progress: true

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest]

steps:
- name: Check out the repo
uses: actions/checkout@v1

- name: Install Node.js, npm, and Yarn
uses: actions/setup-node@v1
with:
node-version: 10

- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}

# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
44 changes: 44 additions & 0 deletions .github/workflows/clear-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Clear cache

on:
workflow_dispatch:

permissions:
actions: write

jobs:
clear-cache:
runs-on: ubuntu-latest
steps:
- name: Clear cache
uses: actions/github-script@v6
with:
script: |
try{
const congif = {
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
};
console.log("Getting first 100 caches from github...")
let caches = await github.rest.actions.getActionsCacheList(congif);
while(caches.data.actions_caches.length){
for (const cache of caches.data.actions_caches) {
console.log("Deleting cache...");
const res = await github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
});
}
caches = await github.rest.actions.getActionsCacheList(congif);
console.log(`Getting another ${caches.data.actions_caches.length} caches from github...`);
}
console.log("Clear completed");
} catch(e) {
console.log("The workflow had terminated with an error:", e)
return;
}
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ name: Test

on: [push, pull_request]

concurrency:
group: test
cancel-in-progress: true

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [windows-latest, ubuntu-latest]
os: [windows-latest]

steps:
- name: Check out Git repository
Expand Down
11 changes: 9 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "marketeye-desktop-app",
"description": "A private desktop app to analyze the stock market based on MarketEye API and electron-react-boilerplate",
"version": "1.4.0",
"version": "1.4.1",
"scripts": {
"build": "npm run build:main && npm run build:renderer",
"build:main": "cross-env NODE_ENV=production TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.prod.ts",
Expand Down Expand Up @@ -90,17 +90,17 @@
"publish": {
"provider": "github",
"owner": "andreyxdd",
"repo": "marketeye-desktop-app"
"repo": "marketeye-client"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/andreyxdd/marketeye-desktop-app.git.git"
"url": "git+https://github.com/andreyxdd/marketeye-client.git.git"
},
"author": {
"name": "Andrey Volkov",
"name": "Andrei Volkov",
"email": "volkov@ualberta.ca",
"url": "https://linktr.ee/andreyxdd"
"url": "https://github.com/andreyxdd"
},
"license": "MIT",
"keywords": [
Expand All @@ -114,7 +114,7 @@
"market",
"marketeye"
],
"homepage": "https://github.com/andreyxdd/marketeye-desktop-app#readme",
"homepage": "https://github.com/andreyxdd/marketeye-client#readme",
"jest": {
"testURL": "http://localhost/",
"testEnvironment": "jsdom",
Expand Down

0 comments on commit 0eabd9d

Please sign in to comment.