From 3325563116c6c969b8545ca0c841b78becb10bd0 Mon Sep 17 00:00:00 2001 From: Ira Hopkinson Date: Fri, 20 Jan 2023 14:30:21 +1300 Subject: [PATCH] Configure publishing to GH - Add GH release config used to generate release notes - also add `.nvmrc` to specify default node version on macos and linux --- .github/release.yml | 19 +++++++++++++++++++ .github/workflows/publish.yml | 12 ++++++------ .nvmrc | 1 + README.md | 15 +++++++++++++++ 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .github/release.yml create mode 100644 .nvmrc diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000000..aa78df4dfe --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,19 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - octocat + - dependabot + categories: + - title: Breaking Changes 🛠 + labels: + - Semver-Major + - breaking-change + - title: Exciting New Features 🎉 + labels: + - Semver-Minor + - enhancement + - title: Other Changes + labels: + - '*' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1601995d50..288cda55f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,19 +2,17 @@ name: Publish on: push: - branches: - - main + branches: [release/*] jobs: publish: - # To enable auto publishing to github, update your electron publisher - # config in package.json > "build" and remove the conditional below - if: ${{ github.repository_owner == 'electron-react-boilerplate' }} + name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: + node_version: [16.x] os: [macos-latest] steps: @@ -24,7 +22,7 @@ jobs: - name: Install Node and NPM uses: actions/setup-node@v3 with: - node-version: 16 + node-version: ${{ matrix.node_version }} cache: npm - name: Install and build @@ -34,6 +32,8 @@ jobs: npm run build - name: Publish releases + # If the commit is tagged with a version (e.g. "v1.2.3"), + if: ${{ startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.') }} env: # These values are used for auto updates signing APPLE_ID: ${{ secrets.APPLE_ID }} diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..99cdd8009c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.15.0 diff --git a/README.md b/README.md index 26ea98a7e5..0a5be3be93 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,21 @@ To package apps for the local platform: npm run package ``` +## Publishing + +1. Create a branch of the form `release/*`, e.g. `release/v1.2.3`, or `release/v1.2.3-rc1`. +2. Update the _version_ in your project's `package.json` file (e.g. _1.2.3_). +3. Run `npm i` to update `package-lock.json`. +4. Create a new draft GitHub **Release**, ensure the following are included: + - a _Tag version_, e.g. `v1.2.3`. + - a copy of the change log. Click **Generate release notes** as a starting point. +5. Update `CHANGELOG.md` with changes in this release from the GitHub draft **Release**. +6. Commit these changes to your release branch. +7. Tag your commit, e.g. `v1.2.3`. +8. Push the tag then the commit to GitHub. +9. Once the GitHub build **Action** has finished, it will add build artifact files to the draft release. Remove the `.blockmap` and `.yml` files and leave the executable, e.g. `.exe` on Windows. +10. Publish the release on GitHub. + ## Linux Development Add the system libraries needed for Electron, [Build Instructions (Linux)](https://www.electronjs.org/docs/latest/development/build-instructions-linux).