Skip to content

Commit

Permalink
Merge branch 'Polaris257-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Heath123 committed Jun 12, 2021
2 parents 7a34dc4 + 43b36cb commit c6eb667
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 51 deletions.
129 changes: 129 additions & 0 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Build pakkit

on: push

jobs:
build-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Install Wine
run: sudo apt install wine64

- name: Install node-prune
run: curl -sf https://gobinaries.com/tj/node-prune | sh

- run: npm install

- name: Build for Windows
run: |
npx electron-forge package --platform win32
cd out/pakkit-win32-x64/resources/app/; node-prune; npx electron-rebuild -v 8.5.2
- name: Build for Linux
run: |
npx electron-forge package --platform linux
cd out/pakkit-linux-x64/resources/app/; node-prune; npx electron-rebuild -v 8.5.2;
- run: chmod +x out/pakkit-linux-x64/pakkit

- name: Build for macOS
run: |
npx electron-forge package --platform darwin
cd out/pakkit-darwin-x64/pakkit.app/Contents/Resources/app/; node-prune; npx electron-rebuild -v 8.5.2
- name: Create archives for new release
if: ${{ github.ref == 'refs/heads/master' }}
run: |
mv out/pakkit-win32-x64 pakkit-windows-x64
mv out/pakkit-linux-x64 pakkit-linux-x64
mv out/pakkit-darwin-x64 pakkit-macos-x64
zip -r -y out/pakkit-windows-x64.zip pakkit-windows-x64/
zip -r -y out/pakkit-linux-x64.zip pakkit-linux-x64/
zip -r -y out/pakkit-macos-x64.zip pakkit-macos-x64/
- name: Create release
id: create_release
uses: actions/create-release@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: github-${{ github.run_number }}
release_name: GitHub build ${{ github.run_number }}
body: github-${{ github.run_number }}

- name: Upload Windows build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-windows-x64.zip
asset_name: pakkit-windows-x64.zip
asset_content_type: application/zip

- name: Upload Linux build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-linux-x64.zip
asset_name: pakkit-linux-x64.zip
asset_content_type: application/zip

- name: Upload macOS build
uses: actions/upload-release-asset@v1
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: out/pakkit-macos-x64.zip
asset_name: pakkit-macos-x64.zip
asset_content_type: application/zip

- name: Prepare to upload artifacts
if: ${{ github.ref != 'refs/heads/master' }}
run: |
mkdir out/windows
mkdir out/linux
mkdir out/macos
mv out/pakkit-win32-x64 out/windows/pakkit-windows-x64
mv out/pakkit-linux-x64 out/linux/pakkit-linux-x64
mv out/pakkit-darwin-x64 out/macos/pakkit-macos-x64
- name: Upload Windows artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-windows-x64
path: out/windows/

- name: Upload Linux artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-linux-x64
path: out/linux/

- name: Upload macOS artifact
uses: actions/upload-artifact@v2
if: ${{ github.ref != 'refs/heads/master' }}
with:
name: pakkit-macos-x64
path: out/macos/
51 changes: 0 additions & 51 deletions Jenkinsfile

This file was deleted.

0 comments on commit c6eb667

Please sign in to comment.