new yarn #923
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
name: Latest Build | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
nwjs: ['0.44.5', '0.85.0'] | |
steps: | |
- name: Context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://git@github.com/ | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: yarn version | |
run: | | |
yarn version | |
- name: node version | |
run: | | |
node --version | |
- uses: kiriles90/variable-mapper@master | |
with: | |
key: "${{ matrix.os }}" | |
map: | | |
{ | |
"ubuntu-latest": { "platform": "linux", "dist": "linux32,linux64" }, | |
"macOS-latest": { "platform": "osx", "dist": "osx64" }, | |
"windows-latest": { "platform": "win", "dist": "win32,win64" } | |
} | |
- name: Build info | |
run: echo Build ${{ env.dist }} on nw-v${{ matrix.nwjs }} | |
- name: Build App | |
run: | | |
yarn | |
yarn gulp dist --platforms=${{ env.platform == 'win' && '"' || '' }}${{ env.dist }}${{ env.platform == 'win' && '"' || '' }} --nwVersion=${{ matrix.nwjs }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.platform }}-${{ matrix.nwjs }} | |
path: build | |
packs: | |
needs: build | |
name: Packs | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
nwjs: ['0.44.5', '0.85.0'] | |
steps: | |
- name: Context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v4 | |
with: | |
path: repo | |
persist-credentials: false | |
- uses: actions/download-artifact@v4 | |
with: | |
name: linux-${{ matrix.nwjs }} | |
path: . | |
- name: Install packages and appimagetool | |
run: | | |
sudo apt update | |
sudo apt install -y libfuse2 | |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage | |
chmod +x appimagetool-x86_64.AppImage | |
- name: Build AppImage | |
run: | | |
VER=$(ls *-linux64*.zip | sed 's/-linux64.*//') | |
echo $VER | |
unzip -q *-linux64*.zip -d $VER.AppDir | |
cp repo/dist/linux/appimage/* $VER.AppDir/ | |
ln -s Popcorn-Time $VER.AppDir/AppRun | |
mkdir build | |
./appimagetool-x86_64.AppImage $VER.AppDir build/$VER-linux${{ matrix.nwjs == '0.44.5' && '-0.44.5' || '' }}.AppImage | |
- name: Upload artifacts | |
uses: actions/upload-artifact@master | |
with: | |
name: linux-${{ matrix.nwjs }}.AppImage | |
path: build | |
release: | |
needs: packs | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Context | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- name: Display structure of downloaded files | |
run: ls -R artifacts | |
- uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
allowUpdates: true | |
name: ${{ github.ref_name }} | |
artifacts: "artifacts/*" |