diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dbfee3a --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 7807ac3..3d76a78 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ /renderer/.next/ /renderer/out/ /main/ +/dist/ # production /build diff --git a/README.md b/README.md index 37b9fe2..a387a4b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index ceb42a5..8f87b6d 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "type-check": "tsc" }, "build": { + "artifactName": "app-${os}.${ext}", "asar": true, "files": [ "main",