Skip to content

Commit

Permalink
Update GH workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed Jul 11, 2024
1 parent 6c454a5 commit 4ce3ab5
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 125 deletions.
89 changes: 44 additions & 45 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build electron releases - development

env:
NODE_VERSION: "14.18"
NODE_VERSION: "18.20"

on:
push:
Expand All @@ -11,54 +11,53 @@ on:
# branches: [ ] # "develop"

jobs:
prep-release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: package_json
run: |
content=`cat ./package.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=json::$content"
- name: Create tag string
id: create_tag_str
run: |
tag=$(basename "${{ github.ref }}")-$(date +%Y%m%d)
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Update package.json snapshot version
uses: jossef/[email protected]
with:
file: package.json
field: version
value: "${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
release_name: "v${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
draft: true
prerelease: true
# prep-release:
# name: Create GitHub Release
# runs-on: ubuntu-latest
# outputs:
# release_id: ${{ steps.create_release.outputs.id }}
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - id: package_json
# run: |
# content=`cat ./package.json`
# # the following lines are only required for multi line json
# content="${content//'%'/'%25'}"
# content="${content//$'\n'/'%0A'}"
# content="${content//$'\r'/'%0D'}"
# # end of optional handling for multi line json
# echo "::set-output name=json::$content"
# - name: Create tag string
# id: create_tag_str
# run: |
# tag=$(basename "${{ github.ref }}")-$(date +%Y%m%d)
# echo "tag=$tag" >> $GITHUB_OUTPUT
# - name: Update package.json snapshot version
# uses: jossef/[email protected]
# with:
# file: package.json
# field: version
# value: "${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: "v${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
# release_name: "v${{ fromJson(steps.package_json.outputs.json).version }}-${{ steps.create_tag_str.outputs.tag }}"
# draft: true
# prerelease: true

build-matrix:
needs: [ prep-release ]
# needs: [ prep-release ]
strategy:
fail-fast: false
matrix:
node-version: [14.18]
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-latest, windows-latest, macos-13 ]

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

Expand All @@ -69,7 +68,7 @@ jobs:
with:
node-version: "${{ env.NODE_VERSION }}"
- run: make install
- run: make publish_release
- run: make publish-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PUBLISH_FOR_PULL_REQUEST: true
83 changes: 41 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,57 @@
name: Build electron releases

env:
NODE_VERSION: "14.18"
NODE_VERSION: "18.20"

on:
push:
branches: [ "main" ]

jobs:
prep-release:
name: Create GitHub Release
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create_release.outputs.id }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: package_json
run: |
content=`cat ./package.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=json::$content"
- name: Create tag
id: create_tag
run: |
if [[ "$(basename "${{ github.ref }}")" == "main" ]]; then
tag=v${{ fromJson(steps.package_json.outputs.json).version }}
else
tag=$(basename "${{ github.ref }}")-${{ fromJson(steps.package_json.outputs.json).version }}-$(date +%Y%m%d.%H%M%S)
fi
echo "tag=$tag" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.create_tag.outputs.tag }}
release_name: ${{ steps.create_tag.outputs.tag }}
draft: true
prerelease: false
# prep-release:
# name: Create GitHub Release
# runs-on: ubuntu-latest
# outputs:
# release_id: ${{ steps.create_release.outputs.id }}
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - id: package_json
# run: |
# content=`cat ./package.json`
# # the following lines are only required for multi line json
# content="${content//'%'/'%25'}"
# content="${content//$'\n'/'%0A'}"
# content="${content//$'\r'/'%0D'}"
# # end of optional handling for multi line json
# echo "::set-output name=json::$content"
# - name: Create tag
# id: create_tag
# run: |
# if [[ "$(basename "${{ github.ref }}")" == "main" ]]; then
# tag=v${{ fromJson(steps.package_json.outputs.json).version }}
# else
# tag=$(basename "${{ github.ref }}")-${{ fromJson(steps.package_json.outputs.json).version }}-$(date +%Y%m%d.%H%M%S)
# fi
# echo "tag=$tag" >> $GITHUB_OUTPUT
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.create_tag.outputs.tag }}
# release_name: ${{ steps.create_tag.outputs.tag }}
# draft: true
# prerelease: false

build-matrix:
needs: [ prep-release ]
# needs: [ prep-release ]
strategy:
fail-fast: false
matrix:
node-version: [14.18]
os: [ ubuntu-latest, windows-latest, macos-latest ]

runs-on: ${{ matrix.os }}
Expand All @@ -64,6 +63,6 @@ jobs:
with:
node-version: "${{ env.NODE_VERSION }}"
- run: make install
- run: make publish_release
- run: make publish-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ default: test

## Setup

yarn.lock: package.json
yarn install # --ignore-optional
touch yarn.lock

# We do actually use a dummy install file to track this
yarn.lock: package.json
yarn install # --ignore-optional
touch yarn.lock

install: package.json yarn.lock
yarn install
Expand All @@ -34,7 +31,6 @@ lint: install
yarn run vue-cli-service lint
# yarn lint


## Intermediate files

src/imods.tar.gz: $(wildcard src/imods/*) $(wildcard src/imods/*/*)
Expand All @@ -51,20 +47,17 @@ test: install src/imods.tar.gz
yarn run vue-cli-service electron:serve $(SERVE_FLAGS)
# yarn dev


## Building output

.PHONY: build
build: install src/imods.tar.gz
yarn run vue-cli-service electron:build
# yarn electron:build


.PHONY: publish-release
publish-release: install src/imods.tar.gz
yarn run vue-cli-service electron:build -p always

.PHONY: help
help:
grep -E '(^[^.#[:space:]].*:)|(##)' Makefile

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"engines": {
"node": ">= 18"
"node": ">= 18.20"
},
"version": "2.5.0",
"license": "GPL-3.0",
Expand Down Expand Up @@ -74,6 +74,7 @@
"@vue/cli-service": "^4.5",
"@vue/devtools": "^6.5.0",
"@vue/eslint-config-standard": "^5.1.2",
"acorn": "^8",
"babel-loader": "^8.1.2",
"css-loader": "^3.5",
"electron": "^9.0.0",
Expand All @@ -100,12 +101,12 @@
"webpack": "^4.18.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"yaml-loader": "^0.8.0",
"acorn": "^8"
"yaml-loader": "^0.8.0"
},
"resolutions": {
"@achrinza/node-ipc": "^10",
"acorn-jsx": "^5.3.2",
"terser-webpack-plugin": "^3.0.3",
"vue-cli-plugin-electron-builder/electron-builder": "^24",
"vue-loader": "~15.9"
}
Expand Down
32 changes: 5 additions & 27 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,7 @@ cac@^3.0.3:
suffix "^0.1.0"
text-table "^0.2.0"

cacache@^12.0.2, cacache@^12.0.3:
cacache@^12.0.3:
version "12.0.4"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.4.tgz#668bcbd105aeb5f1d92fe25570ec9525c8faa40c"
integrity sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==
Expand Down Expand Up @@ -6110,7 +6110,7 @@ err-code@^2.0.2:
resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9"
integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==

errno@^0.1.3, errno@~0.1.7:
errno@^0.1.3:
version "0.1.8"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f"
integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==
Expand Down Expand Up @@ -13741,22 +13741,7 @@ temp-file@^3.4.0:
async-exit-hook "^2.0.1"
fs-extra "^10.0.0"

terser-webpack-plugin@^1.4.3, terser-webpack-plugin@^1.4.4:
version "1.4.5"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b"
integrity sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==
dependencies:
cacache "^12.0.2"
find-cache-dir "^2.1.0"
is-wsl "^1.1.0"
schema-utils "^1.0.0"
serialize-javascript "^4.0.0"
source-map "^0.6.1"
terser "^4.1.2"
webpack-sources "^1.4.0"
worker-farm "^1.7.0"

terser-webpack-plugin@^3.0.3:
terser-webpack-plugin@^1.4.3, terser-webpack-plugin@^1.4.4, terser-webpack-plugin@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-3.1.0.tgz#91e6d39571460ed240c0cf69d295bcf30ebf98cb"
integrity sha512-cjdZte66fYkZ65rQ2oJfrdCAkkhJA7YLYk5eGOcGCSGlq0ieZupRdjedSQXYknMPo2IveQL+tPdrxUkERENCFA==
Expand All @@ -13771,7 +13756,7 @@ terser-webpack-plugin@^3.0.3:
terser "^4.8.0"
webpack-sources "^1.4.3"

terser@^4.1.2, terser@^4.8.0:
terser@^4.8.0:
version "4.8.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.8.1.tgz#a00e5634562de2239fd404c649051bf6fc21144f"
integrity sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==
Expand Down Expand Up @@ -14924,7 +14909,7 @@ webpack-merge@^5.7.3:
flat "^5.0.2"
wildcard "^2.0.0"

webpack-sources@^1.1.0, webpack-sources@^1.4.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
webpack-sources@^1.1.0, webpack-sources@^1.4.1, webpack-sources@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933"
integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==
Expand Down Expand Up @@ -15046,13 +15031,6 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

worker-farm@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8"
integrity sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==
dependencies:
errno "~0.1.7"

[email protected]:
version "6.2.1"
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
Expand Down

0 comments on commit 4ce3ab5

Please sign in to comment.