Skip to content

Commit

Permalink
Merge pull request #1 from Jai-JAP/patch-2
Browse files Browse the repository at this point in the history
Patch 2
  • Loading branch information
Jai-JAP authored May 5, 2022
2 parents cf8b3ea + e291e00 commit ccd6250
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 27 deletions.
64 changes: 49 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
node-version: [14.x]
runtime: [ linux-x64, linux-armv7l, linux-arm64, win-x64, osx-x64 ]
runtime: [ linux-x64, linux-armv7l, linux-arm64, win-x64, win-arm64, osx-x64, osx-arm64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
Expand All @@ -26,9 +26,15 @@ jobs:
- runtime: osx-x64
os: macOS-latest

- runtime: osx-arm64
os: macOS-latest

- runtime: win-x64
os: windows-latest

- runtime: win-arm64
os: windows-latest

runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -76,7 +82,7 @@ jobs:


- name: Install libarchive-tools
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt -y install libarchive-tools; echo "Version Number ${{ toJson(job) }} ${{ toJson(needs) }}"

- name: Build x64 with Node.js ${{ matrix.node-version}}
Expand All @@ -88,7 +94,7 @@ jobs:
run: npm run build:arm32 --if-present

- name: Build ARM64 with Node.js ${{ matrix.node-version}}
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
if: contains(matrix.runtime, 'arm64')
run: npm run build:arm64 --if-present

- name: Upload Linux .zip x64 Artifact
Expand Down Expand Up @@ -205,30 +211,58 @@ jobs:
# name: freetube_${{ steps.versionNumber.outputs.result }}_static_web
# path: dist/web

- name: Upload Windows .exe Artifact
- name: Upload Windows x64 .exe Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-setup-x64.exe
path: build/freetube Setup ${{ steps.versionNumber.outputs.result }}.exe

- name: Upload Windows arm64 .exe Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-setup-arm64.exe
path: build/freetube Setup ${{ steps.versionNumber.outputs.result }}.exe

- name: Upload Windows x64 .zip Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-win-x64-portable
path: build/freetube-${{ steps.versionNumber.outputs.result }}-win.zip

- name: Upload Windows .zip Artifact
- name: Upload Windows arm64 .zip Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-setup-x64.exe
path: build/freetube Setup ${{ steps.versionNumber.outputs.result }}.exe

- name: Upload Windows Portable Artifact
name: freetube-${{ steps.versionNumber.outputs.result }}-win-arm64-portable
path: build/freetube-${{ steps.versionNumber.outputs.result }}-win.zip
- name: Upload Windows x64 Portable Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-portable-x64.exe
path: build/freetube ${{ steps.versionNumber.outputs.result }}.exe

- name: Upload Mac .dmg Artifact
- name: Upload Windows arm64 Portable Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-portable-arm64.exe
path: build/freetube ${{ steps.versionNumber.outputs.result }}.exe

- name: Upload Mac x64 .dmg Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-x64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-mac-x64.dmg
path: build/freetube-${{ steps.versionNumber.outputs.result }}.dmg

- name: Upload Mac arm64 .dmg Artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-arm64')
with:
name: freetube-${{ steps.versionNumber.outputs.result }}-mac.dmg
name: freetube-${{ steps.versionNumber.outputs.result }}-mac-arm64.dmg
path: build/freetube-${{ steps.versionNumber.outputs.result }}.dmg
81 changes: 71 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
node-version: [14.x]
runtime: [ linux-x64, linux-armv7l, linux-arm64, win-x64, osx-x64 ]
runtime: [ linux-x64, linux-armv7l, linux-arm64, win-x64, win-arm64, osx-x64, osx-arm64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
Expand All @@ -26,9 +26,15 @@ jobs:

- runtime: osx-x64
os: macOS-latest


- runtime: osx-arm64
os: macOS-latest

- runtime: win-x64
os: windows-latest

- runtime: win-arm64
os: windows-latest

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -57,7 +63,7 @@ jobs:
run: npm run build:arm32 --if-present

- name: Build ARM64 with Node.js ${{ matrix.node-version}}
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
if: contains(matrix.runtime, 'arm64')
run: npm run build:arm64 --if-present

- name: Upload AppImage x64 Release
Expand Down Expand Up @@ -161,9 +167,9 @@ jobs:
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.aarch64.rpm
asset_content_type: application/x-rpm

- name: Upload Windows .exe Release
- name: Upload Windows x64 .exe Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -172,9 +178,20 @@ jobs:
asset_path: build/freetube Setup ${{ env.PACKAGE_VERSION }}.exe
asset_content_type: application/x-ms-dos-executable

- name: Upload Windows .zip Release
- name: Upload Windows arm64 .exe Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-setup-arm64.exe
asset_path: build/freetube Setup ${{ env.PACKAGE_VERSION }}.exe
asset_content_type: application/x-ms-dos-executable

- name: Upload Windows x64 .zip Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -183,13 +200,57 @@ jobs:
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}-win.zip
asset_content_type: application/zip

- name: Upload Mac .dmg Release
- name: Upload Windows arm64 .zip Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-win-arm64-portable.zip
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}-win.zip
asset_content_type: application/zip

- name: Upload Windows x64 portable Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-win-x64-portable.exe
asset_path: build/FreeTube ${{ env.PACKAGE_VERSION }}.exe
asset_content_type: application/x-ms-dos-executable

- name: Upload Windows arm64 portable Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-win-arm64-portable.exe
asset_path: build/FreeTube ${{ env.PACKAGE_VERSION }}.exe
asset_content_type: application/x-ms-dos-executable

- name: Upload Mac x64 .dmg Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-x64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-mac-x64.dmg
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.dmg
asset_content_type: application/x-apple-diskimage

- name: Upload Mac arm64 .dmg Release
uses: actions/upload-release-asset@v1
if: startsWith(matrix.os, 'macos')
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-arm64')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/FreeTubeApp/FreeTube/releases/${{ secrets.UPLOAD_ID }}/assets{?name,label}
asset_name: freetube-${{ env.PACKAGE_VERSION }}-mac.dmg
asset_name: freetube-${{ env.PACKAGE_VERSION }}-mac-arm64.dmg
asset_path: build/freetube-${{ env.PACKAGE_VERSION }}.dmg
asset_content_type: application/x-apple-diskimage
16 changes: 14 additions & 2 deletions _scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@ let targets
var platform = os.platform()

if (platform == 'darwin') {
targets = Platform.MAC.createTarget()
let arch = Arch.x64

if (args[2] === 'arm64') {
arch = Arch.arm64
}

targets = Platform.MAC.createTarget(['DMG','zip'], arch)
} else if (platform == 'win32') {
targets = Platform.WINDOWS.createTarget()
let arch = Arch.x64

if (args[2] === 'arm64') {
arch = Arch.arm64
}

targets = Platform.WINDOWS.createTarget(['nsis', 'zip', 'portable', 'squirrel'], arch)
} else if (platform == 'linux') {
let arch = Arch.x64

Expand Down

0 comments on commit ccd6250

Please sign in to comment.