-
Notifications
You must be signed in to change notification settings - Fork 714
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Build via GitHub Actions (#1860)
* Set snapshot version * Add Linux build script * Add macOS build script * Add Windows build script * Add unified build script * Use a unified build script * Remove Travis and AppVeyor scripts * Fix macOS build issue * Add some comments
- Loading branch information
Showing
5 changed files
with
242 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,240 @@ | ||
name: Build | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- run: yarn test | ||
|
||
bundle: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- run: yarn eslint | ||
- run: yarn build | ||
env: | ||
NODE_ENV: production | ||
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
|
||
smoke-test-windows-build: | ||
needs: bundle | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
- run: yarn electron-builder --x64 --dir | ||
env: | ||
CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | ||
- run: | | ||
$job = Start-Job -ScriptBlock { .\dist\win-unpacked\Rocket.Chat.exe } | ||
if (Wait-Job $job -Timeout 30) { | ||
Write-Host $(Receive-Job -Job $job) | ||
} | ||
Remove-Job -force $job | ||
- run: yarn electron-builder --ia32 --dir | ||
env: | ||
CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | ||
- run: | | ||
$job = Start-Job -ScriptBlock { .\dist\win-ia32-unpacked\Rocket.Chat.exe } | ||
if (Wait-Job $job -Timeout 30) { | ||
Write-Host $(Receive-Job -Job $job) | ||
} | ||
Remove-Job -force $job | ||
smoke-test-macos-build: | ||
needs: bundle | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
- run: yarn electron-builder --dir | ||
env: | ||
CSC_LINK: ${{ secrets.MAC_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} | ||
- run: | | ||
brew install coreutils | ||
gtimeout 30 ./dist/mac/Rocket.Chat.app/Contents/MacOS/Rocket.Chat || code=$? | ||
if [[ $code -ne 124 && $code -ne 0 ]]; then | ||
exit $code; | ||
fi | ||
smoke-test-linux-build: | ||
needs: bundle | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
- run: yarn electron-builder --dir | ||
env: | ||
CSC_LINK: ${{ secrets.MAC_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} | ||
- run: | | ||
xvfb-run timeout 30 ./dist/linux-unpacked/rocketchat-desktop || code=$? | ||
if [[ $code -ne 124 && $code -ne 0 ]]; then | ||
exit $code; | ||
fi | ||
windows-build: | ||
if: ${{ github.event_name == 'push' }} | ||
needs: smoke-test-windows-build | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
- run: yarn electron-builder | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
CSC_LINK: ${{ secrets.WIN_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: windows-dist | ||
path: ./dist | ||
|
||
macos-build: | ||
if: ${{ github.event_name == 'push' }} | ||
needs: smoke-test-macos-build | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
# Disable Spotlight indexing due to a error when generating DMG | ||
# See https://github.com/electron-userland/electron-builder/issues/4606#issuecomment-667641621 | ||
- run: mdutil -a -i off | ||
- run: yarn electron-builder | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
CSC_LINK: ${{ secrets.MAC_CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} | ||
# Variables needed to notarization process: | ||
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }} | ||
APPLEID: ${{ secrets.APPLEID }} | ||
APPLEIDPASS: ${{ secrets.APPLEIDPASS }} | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: macos-dist | ||
path: ./dist | ||
|
||
linux-build: | ||
if: ${{ github.event_name == 'push' }} | ||
needs: smoke-test-linux-build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '12' | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
- run: yarn --check-files | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: app | ||
path: ./app | ||
# Snap builds must be separate as they aren't published in GitHub Releases | ||
- run: yarn electron-builder --linux tar.gz deb rpm | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- uses: samuelmeuli/action-snapcraft@v1 | ||
with: | ||
snapcraft_token: ${{ secrets.SNAP_TOKEN }} | ||
- if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
run: yarn electron-builder --publish always --linux snap -c.publish.1.provider=snapStore -c.publish.1.channel=stable | ||
- if: ${{ github.ref == 'refs/heads/master' }} | ||
run: yarn electron-builder --publish always --linux snap -c.publish.1.provider=snapStore -c.publish.1.channel=candidate | ||
- if: ${{ startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/hotfix/') }} | ||
run: yarn electron-builder --publish always --linux snap -c.publish.1.provider=snapStore -c.publish.1.channel=beta | ||
- if: ${{ startsWith(github.ref, 'refs/heads/') }} | ||
run: yarn electron-builder --publish always --linux snap -c.publish.1.provider=snapStore -c.publish.1.channel=edge | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: linux-dist | ||
path: ./dist |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters