Skip to content

Commit

Permalink
Auto-generate release
Browse files Browse the repository at this point in the history
  • Loading branch information
kmturley committed Aug 2, 2020
1 parent 6bb51ea commit ca7c212
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}

build_release:
name: Build release
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
file_name: app-linux
- os: macos-latest
file_name: app-mac.dmg
- os: windows-latest
file_name: app-win.exe
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'

- name: Install macOS dependencies
if: matrix.os == 'macOS-latest'

- name: Install Windows dependencies
if: matrix.os == 'windows-latest'

- name: Setup
shell: bash
run: |
npm install
- name: Build
shell: bash
run: |
npm run dist
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./dist/${{ matrix.file_name }}
asset_name: ${{ matrix.file_name }}
asset_content_type: application/octet-stream
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/renderer/.next/
/renderer/out/
/main/
/dist/

# production
/build
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ View the app in the application window opened automatically
Release an updated version on GitHub by simply creating a version tag:

npm version patch
git push origin --tags
git push && git push origin --tags

This will run an automated build and deploy process on GitHub Actions:

.github/workflows/workflow.yml
.github/workflows/release.yml


## Contact
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"type-check": "tsc"
},
"build": {
"artifactName": "app-${os}.${ext}",
"asar": true,
"files": [
"main",
Expand Down

0 comments on commit ca7c212

Please sign in to comment.