mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
3.7 edits
This commit is contained in:
parent
31163e8516
commit
ad736edd9e
1 changed files with 241 additions and 5 deletions
246
.github/workflows/build.yml
vendored
246
.github/workflows/build.yml
vendored
|
|
@ -3,6 +3,8 @@ name: Build Void
|
|||
on:
|
||||
push:
|
||||
branches: [ main, release/*, github-workflow ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
@ -16,6 +18,7 @@ jobs:
|
|||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
|
@ -36,11 +39,62 @@ jobs:
|
|||
ARCHIVE_PATH=".build/linux/client/void-linux-x64.tar.gz"
|
||||
tar -czf $ARCHIVE_PATH -C .. VSCode-linux-x64
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
cd .build/linux/client
|
||||
sha256sum void-linux-x64.tar.gz > void-linux-x64.tar.gz.sha256
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-linux-x64
|
||||
path: .build/linux/client/void-linux-x64.tar.gz
|
||||
path: |
|
||||
.build/linux/client/void-linux-x64.tar.gz
|
||||
.build/linux/client/void-linux-x64.tar.gz.sha256
|
||||
|
||||
build-linux-arm64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y pkg-config libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-dev
|
||||
npm install
|
||||
npm install -g node-gyp
|
||||
npm install -g gulp-cli
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm run buildreact
|
||||
npm run gulp vscode-linux-arm64-min
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p .build/linux/client
|
||||
ARCHIVE_PATH=".build/linux/client/void-linux-arm64.tar.gz"
|
||||
tar -czf $ARCHIVE_PATH -C .. VSCode-linux-arm64
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
cd .build/linux/client
|
||||
sha256sum void-linux-arm64.tar.gz > void-linux-arm64.tar.gz.sha256
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-linux-arm64
|
||||
path: |
|
||||
.build/linux/client/void-linux-arm64.tar.gz
|
||||
.build/linux/client/void-linux-arm64.tar.gz.sha256
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
|
@ -52,6 +106,7 @@ jobs:
|
|||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
|
@ -70,11 +125,64 @@ jobs:
|
|||
Compress-Archive -Path ..\VSCode-win32-x64\* -DestinationPath .build\win32-x64\void-win32-x64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
cd .build/win32-x64
|
||||
$hash = Get-FileHash -Algorithm SHA256 void-win32-x64.zip
|
||||
$hash.Hash | Out-File -Encoding ascii void-win32-x64.zip.sha256
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-win32-x64
|
||||
path: .build/win32-x64/void-win32-x64.zip
|
||||
path: |
|
||||
.build/win32-x64/void-win32-x64.zip
|
||||
.build/win32-x64/void-win32-x64.zip.sha256
|
||||
|
||||
build-windows-arm64:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install
|
||||
npm install -g node-gyp
|
||||
npm install -g gulp-cli
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
npm run buildreact
|
||||
npm run gulp vscode-win32-arm64-min
|
||||
|
||||
- name: Package
|
||||
run: |
|
||||
mkdir -p .build/win32-arm64
|
||||
Compress-Archive -Path ..\VSCode-win32-arm64\* -DestinationPath .build\win32-arm64\void-win32-arm64.zip
|
||||
shell: pwsh
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
cd .build/win32-arm64
|
||||
$hash = Get-FileHash -Algorithm SHA256 void-win32-arm64.zip
|
||||
$hash.Hash | Out-File -Encoding ascii void-win32-arm64.zip.sha256
|
||||
shell: pwsh
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-win32-arm64
|
||||
path: |
|
||||
.build/win32-arm64/void-win32-arm64.zip
|
||||
.build/win32-arm64/void-win32-arm64.zip.sha256
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
|
|
@ -89,6 +197,7 @@ jobs:
|
|||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
|
@ -116,6 +225,7 @@ jobs:
|
|||
echo "SIGNED_DOTAPP=${SIGN_DIR}/VSCode-darwin-${{ matrix.arch }}/Void.app" >> $GITHUB_ENV
|
||||
|
||||
- name: Import certificate
|
||||
if: ${{ github.event_name != 'pull_request' && github.repository == 'voideditor/void' }}
|
||||
env:
|
||||
P12_BASE64: ${{ secrets.MACOS_CERTIFICATE }}
|
||||
P12_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
||||
|
|
@ -138,6 +248,7 @@ jobs:
|
|||
security list-keychains -d user -s "${KEYCHAIN}" $(security list-keychains -d user | sed s/\"//g)
|
||||
|
||||
- name: Sign Application
|
||||
if: ${{ github.event_name != 'pull_request' && github.repository == 'voideditor/void' }}
|
||||
env:
|
||||
CODESIGN_IDENTITY: ${{ secrets.MACOS_SIGNING_IDENTITY }}
|
||||
VSCODE_ARCH: ${{ matrix.arch }}
|
||||
|
|
@ -147,16 +258,28 @@ jobs:
|
|||
node sign.js "${SIGN_DIR}"
|
||||
codesign --verify --verbose=4 "${SIGNED_DOTAPP}"
|
||||
|
||||
- name: Create Unsigned App (for PR builds)
|
||||
if: ${{ github.event_name == 'pull_request' || github.repository != 'voideditor/void' }}
|
||||
run: |
|
||||
cp -Rp "$(pwd)/../VSCode-darwin-${{ matrix.arch }}" "${SIGN_DIR}"
|
||||
echo "SIGNED_DOTAPP_DIR=$(pwd)/../VSCode-darwin-${{ matrix.arch }}" >> $GITHUB_ENV
|
||||
echo "SIGNED_DOTAPP=$(pwd)/../VSCode-darwin-${{ matrix.arch }}/Void.app" >> $GITHUB_ENV
|
||||
|
||||
- name: Create DMG
|
||||
run: |
|
||||
cd "${SIGNED_DOTAPP_DIR}"
|
||||
npx create-dmg --volname "Void Installer" "${SIGNED_DOTAPP}" .
|
||||
npx create-dmg --volname "Void Installer" "${SIGNED_DOTAPP}" . || true
|
||||
GENERATED_DMG=$(ls *.dmg)
|
||||
mv "${GENERATED_DMG}" "Void-Installer-darwin-${{ matrix.arch }}.dmg"
|
||||
codesign --verify --verbose=4 "Void-Installer-darwin-${{ matrix.arch }}.dmg"
|
||||
|
||||
if [[ "${{ github.event_name }}" != "pull_request" && "${{ github.repository }}" == "voideditor/void" ]]; then
|
||||
codesign --verify --verbose=4 "Void-Installer-darwin-${{ matrix.arch }}.dmg"
|
||||
fi
|
||||
|
||||
echo "SIGNED_DMG=${SIGNED_DOTAPP_DIR}/Void-Installer-darwin-${{ matrix.arch }}.dmg" >> $GITHUB_ENV
|
||||
|
||||
- name: Notarize
|
||||
if: ${{ github.event_name != 'pull_request' && github.repository == 'voideditor/void' }}
|
||||
env:
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
||||
|
|
@ -200,11 +323,18 @@ jobs:
|
|||
}
|
||||
EOF
|
||||
|
||||
- name: Generate checksum for DMG
|
||||
run: |
|
||||
cd "${SIGNED_DOTAPP_DIR}"
|
||||
shasum -a 256 "Void-Installer-darwin-${{ matrix.arch }}.dmg" > "Void-Installer-darwin-${{ matrix.arch }}.dmg.sha256"
|
||||
|
||||
- name: Upload DMG
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-darwin-${{ matrix.arch }}-dmg
|
||||
path: ${{ env.SIGNED_DMG }}
|
||||
path: |
|
||||
${{ env.SIGNED_DMG }}
|
||||
${{ env.SIGNED_DOTAPP_DIR }}/Void-Installer-darwin-${{ matrix.arch }}.dmg.sha256
|
||||
|
||||
- name: Upload Raw App
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
@ -217,3 +347,109 @@ jobs:
|
|||
with:
|
||||
name: void-darwin-${{ matrix.arch }}-hash
|
||||
path: ${{ env.SIGNED_DOTAPP_DIR }}/Void-UpdJSON-darwin-${{ matrix.arch }}.json
|
||||
|
||||
create-universal-macos:
|
||||
needs: build-macos
|
||||
runs-on: macos-latest
|
||||
if: ${{ github.event_name != 'pull_request' && github.repository == 'voideditor/void' }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download x64 DMG
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: void-darwin-x64-dmg
|
||||
path: .build/darwin-x64
|
||||
|
||||
- name: Download arm64 DMG
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: void-darwin-arm64-dmg
|
||||
path: .build/darwin-arm64
|
||||
|
||||
- name: Download x64 App
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: void-darwin-x64-rawapp
|
||||
path: .build/darwin-x64-app
|
||||
|
||||
- name: Download arm64 App
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: void-darwin-arm64-rawapp
|
||||
path: .build/darwin-arm64-app
|
||||
|
||||
- name: Create Universal App working dir
|
||||
run: |
|
||||
mkdir -p .build/darwin-universal/{x64,arm64,universal}
|
||||
|
||||
- name: Extract Apps
|
||||
run: |
|
||||
unzip -o .build/darwin-x64-app/Void-RawApp-darwin-x64.zip -d .build/darwin-universal/x64
|
||||
unzip -o .build/darwin-arm64-app/Void-RawApp-darwin-arm64.zip -d .build/darwin-universal/arm64
|
||||
|
||||
- name: Create Universal App
|
||||
run: |
|
||||
# Script to create universal binary
|
||||
cd build/darwin
|
||||
node create-universal-app.js \
|
||||
"$(pwd)/../../.build/darwin-universal/arm64/Void.app" \
|
||||
"$(pwd)/../../.build/darwin-universal/x64/Void.app" \
|
||||
"$(pwd)/../../.build/darwin-universal/universal/Void.app"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install create-dmg
|
||||
run: npm install -g create-dmg
|
||||
|
||||
- name: Create Universal DMG
|
||||
run: |
|
||||
cd .build/darwin-universal/universal
|
||||
create-dmg --volname "Void Installer" Void.app . || true
|
||||
GENERATED_DMG=$(ls *.dmg)
|
||||
mv "${GENERATED_DMG}" "../../Void-Installer-darwin-universal.dmg"
|
||||
cd ../..
|
||||
shasum -a 256 Void-Installer-darwin-universal.dmg > Void-Installer-darwin-universal.dmg.sha256
|
||||
|
||||
- name: Upload Universal DMG
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: void-darwin-universal
|
||||
path: |
|
||||
.build/Void-Installer-darwin-universal.dmg
|
||||
.build/Void-Installer-darwin-universal.dmg.sha256
|
||||
|
||||
create-release:
|
||||
needs: [build-linux, build-linux-arm64, build-windows, build-windows-arm64, build-macos, create-universal-macos]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: release-artifacts
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
release-artifacts/void-linux-x64/void-linux-x64.tar.gz
|
||||
release-artifacts/void-linux-x64/void-linux-x64.tar.gz.sha256
|
||||
release-artifacts/void-linux-arm64/void-linux-arm64.tar.gz
|
||||
release-artifacts/void-linux-arm64/void-linux-arm64.tar.gz.sha256
|
||||
release-artifacts/void-win32-x64/void-win32-x64.zip
|
||||
release-artifacts/void-win32-x64/void-win32-x64.zip.sha256
|
||||
release-artifacts/void-win32-arm64/void-win32-arm64.zip
|
||||
release-artifacts/void-win32-arm64/void-win32-arm64.zip.sha256
|
||||
release-artifacts/void-darwin-x64-dmg/Void-Installer-darwin-x64.dmg
|
||||
release-artifacts/void-darwin-x64-dmg/Void-Installer-darwin-x64.dmg.sha256
|
||||
release-artifacts/void-darwin-arm64-dmg/Void-Installer-darwin-arm64.dmg
|
||||
release-artifacts/void-darwin-arm64-dmg/Void-Installer-darwin-arm64.dmg.sha256
|
||||
release-artifacts/void-darwin-universal/Void-Installer-darwin-universal.dmg
|
||||
release-artifacts/void-darwin-universal/Void-Installer-darwin-universal.dmg.sha256
|
||||
draft: true
|
||||
generate_release_notes: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue