Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
garrylachman committed May 22, 2023
1 parent 4615902 commit 90dc7f0
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 50 deletions.
51 changes: 16 additions & 35 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Publish
name: Build/release

on:
workflow_dispatch:
push:
branches:
- develop
tags:
- '*'

concurrency: ci-${{ github.workflow }}

Expand All @@ -23,10 +22,6 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_SEMANTIC_RELEASE }}

- uses: shogo82148/actions-mutex@v1
with:
key: build-mutex

- name: apt-get install
if: matrix.os == 'ubuntu-latest'
run: sudo apt update -y && sudo apt-get install -y snapd rpm snapcraft fakeroot dpkg
Expand All @@ -38,6 +33,10 @@ jobs:
node-version: 18.11.0
cache: 'yarn'

- uses: shogo82148/actions-mutex@v1
with:
key: build-mutex

- name: Install deps
run: yarn install

Expand All @@ -47,34 +46,16 @@ jobs:
- name: Build packages
run: yarn run build

#- name: Build Electron app
# run: yarn run make
# env:
# # 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') }}

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
- 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 }}

#- 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') }}
# 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') }}

#- name: 'Electro Forge Publish'
# run: yarn run publish
51 changes: 51 additions & 0 deletions .github/workflows/tagging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build/prepare

on:
workflow_dispatch:
push:
branches:
- develop

concurrency: ci-${{ github.workflow }}

jobs:
build-and-publish:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout git repo
uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN_SEMANTIC_RELEASE }}

- name: apt-get install
if: matrix.os == 'ubuntu-latest'
run: sudo apt update -y && sudo apt-get install -y snapd rpm snapcraft fakeroot dpkg

- name: Install Node and Yarn
uses: actions/setup-node@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
node-version: 18.11.0
cache: 'yarn'

- name: Install deps
run: yarn install

- name: Install global lerna
run: yarn global add lerna

- name: Test
run: yarn run test

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
14 changes: 1 addition & 13 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm"],
["@semantic-release/exec", {
"prepareCmd": "yarn run make"
}],
["@semantic-release/github", {
"assets": [
{ "path": "out/make/**/electrocrud*.zip", "name": "ElectroCRUD-mac-${nextRelease.gitTag}.zip", "label": "ElectroCRUD MacOS (${nextRelease.gitTag})" },
{ "path": "out/make/**/electrocrud*.exe", "name": "ElectroCRUD-windows-${nextRelease.gitTag}.exe", "label": "ElectroCRUD Windows (${nextRelease.gitTag})" },
{ "path": "out/make/**/electrocrud*.AppImage", "name": "ElectroCRUD-linux-${nextRelease.gitTag}.AppImage", "label": "ElectroCRUD Linux (${nextRelease.gitTag})" },
{ "path": "out/make/**/electrocrud*.deb", "name": "ElectroCRUD-linux-${nextRelease.gitTag}.deb", "label": "ElectroCRUD Linux (deb) (${nextRelease.gitTag})" },
{ "path": "out/make/**/electrocrud*.rpm", "name": "ElectroCRUD-linux-${nextRelease.gitTag}.rpm", "label": "ElectroCRUD Linux (rpm) (${nextRelease.gitTag})" },
{ "path": "out/make/**/electrocrud*.snap", "name": "ElectroCRUD-linux-${nextRelease.gitTag}.snap", "label": "ElectroCRUD Linux (snap) (${nextRelease.gitTag})" }
]}]
["@semantic-release/npm"]
]
}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"test": "NODE_OPTIONS=--experimental-vm-modules npx jest packages",
"make": "cross-env NODE_OPTIONS='--max-old-space-size=8192' DEBUG=* REFORGED_APPIMAGEKIT_CUSTOM_FILENAME='ElectroCRUD-linux' electron-forge make",
"build": "yarn lerna run build",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release --debug"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
Expand Down Expand Up @@ -309,5 +309,11 @@
"workspaces": [
"packages/*"
],
"private": true
"private": true,
"build": {
"appId": "com.garrylachman.electrocrud",
"productName": "ElectroCRUD",
"copyright": "Copyright © 2023 Garry Lachman",
"asar": false
}
}

0 comments on commit 90dc7f0

Please sign in to comment.