diff options
author | 0neGal <mail@0negal.com> | 2022-09-18 21:38:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 21:38:36 +0200 |
commit | 3cf09255cb86608a940b1b524f04ef6dea426121 (patch) | |
tree | 681485ab39394ee6fad6ee4a254bab8669b1b1d7 | |
parent | 096c54e746def93eb6ee1b2a8d91e1e62555d610 (diff) | |
parent | cd087af0f7641312047551229ac1d58da9024802 (diff) | |
download | Viper-3cf09255cb86608a940b1b524f04ef6dea426121.tar.gz Viper-3cf09255cb86608a940b1b524f04ef6dea426121.zip |
Merge pull request #146 from Alystrasz/feat/ci-builds
-rw-r--r-- | .github/workflows/dev_builds.yml | 50 | ||||
-rw-r--r-- | .github/workflows/release_builds.yml | 51 | ||||
-rw-r--r-- | PUBLISH.md | 13 | ||||
-rw-r--r-- | package.json | 12 |
4 files changed, 120 insertions, 6 deletions
diff --git a/.github/workflows/dev_builds.yml b/.github/workflows/dev_builds.yml new file mode 100644 index 0000000..1951ee7 --- /dev/null +++ b/.github/workflows/dev_builds.yml @@ -0,0 +1,50 @@ +name: Development builds CI +on: + push: + pull_request: + types: [opened, reopened] + +jobs: + build-windows: + name: "Create Windows development builds" + runs-on: "windows-latest" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node environment + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Create builds + run: npm run build:windows + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: viper-windows-builds + path: | + dist/*.exe + build-linux: + name: "Create Linux development builds" + runs-on: "ubuntu-latest" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node environment + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Create builds + run: npm run build:linux + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: viper-linux-builds + path: | + dist/*.AppImage + dist/*.tar.gz + dist/*.deb + dist/*.rpm
\ No newline at end of file diff --git a/.github/workflows/release_builds.yml b/.github/workflows/release_builds.yml new file mode 100644 index 0000000..bc3dac6 --- /dev/null +++ b/.github/workflows/release_builds.yml @@ -0,0 +1,51 @@ +name: Release CI +on: + release: + types: [ prereleased ] +jobs: + build-windows: + name: "Create Windows release builds" + runs-on: "windows-latest" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node environment + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Create builds + run: npm run build:windows + - name: Upload production artifacts to release + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "dist/*.exe*;dist/latest.yml" + release_id: ${{ github.event.release.id }} + draft: false + prerelease: true + build-linux: + name: "Create Linux release builds" + runs-on: "ubuntu-latest" + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node environment + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm install + - name: Create builds + run: npm run build:linux + - name: Upload production artifacts to release + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "dist/*.AppImage;dist/*.tar.gz;dist/*.deb;dist/*.rpm;dist/latest-linux.yml" + release_id: ${{ github.event.release.id }} + draft: false + prerelease: true @@ -8,3 +8,16 @@ 6. Build and publish with `npm run publish:[windows/linux]` - Optionally just use `build/publish.sh`, however that only works on Linux/Systems with a `/bin/sh` file, it also checks whether all files have been localized, and that the version numbers have been updated 7. Edit the draft release message and publish the new release! + +## CI release + +If you don't want to build releases yourself, you can make GitHub build them for you! + + 1. Make sure your code works! + 2. Update `package.json` version + 3. Make sure `package.json`'s `repository.url` key references correct repository + 4. Ensure application builds correctly with `npm run build:[windows/linux]` + 5. Create a prerelease with newest version name + - Creating the prerelease will trigger CI, that will build all executables + - You can use build time to update release notes :) + 6. When all binaries have been uploaded to the prerelease, you can publish it!
\ No newline at end of file diff --git a/package.json b/package.json index 51565cd..e2a50b2 100644 --- a/package.json +++ b/package.json @@ -29,12 +29,12 @@ "langs": "node build/langs.js", "start": "npx electron src/index.js", "debug": "npx electron src/index.js --debug", - "build": "npx electron-builder --win nsis --win portable --linux", - "build:windows": "npx electron-builder --win nsis --win portable", - "build:linux": "npx electron-builder --linux", - "publish": "npx electron-builder --win nsis --win portable --linux -p always", - "publish:windows": "npx electron-builder --win nsis --win portable -p always", - "publish:linux": "npx electron-builder --linux -p always" + "build": "npx electron-builder --win nsis --win portable --linux --publish never", + "build:windows": "npx electron-builder --win nsis --win portable --publish never", + "build:linux": "npx electron-builder --linux --publish never", + "publish": "npx electron-builder --win nsis --win portable --linux --publish always", + "publish:windows": "npx electron-builder --win nsis --win portable --publish always", + "publish:linux": "npx electron-builder --linux --publish always" }, "repository": { "type": "git", |