Changing the way we're using nodejs in the github action. #3906
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: macOS CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-openbios: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
set-safe-directory: true | |
- uses: n1hility/cancel-previous-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update packages | |
run: sudo apt-get update | |
- name: Install dependencies | |
run: sudo apt-get install -y g++-mipsel-linux-gnu | |
- name: Build OpenBIOS | |
run: make -C src/mips/openbios -j2 | |
- name: Upload results for MacOS build job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: OpenBIOS | |
path: src/mips/openbios/openbios.bin | |
- name: Build tests | |
run: | | |
make -C src/mips/openbios -j 2 clean | |
make -C src/mips/tests -j 2 PCSX_TESTS=true | |
- name: Upload results for MacOS build job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tests | |
path: '**/*.ps-exe' | |
macos-build-and-test: | |
runs-on: macos-12 | |
needs: build-openbios | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: n1hility/cancel-previous-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies | |
run: ./.github/scripts/install-brew-dependencies.sh | |
- name: Fetch submodules | |
run: git submodule update --init --recursive | |
- name: Build PCSX-Redux | |
run: make -j 2 all pcsx-redux-tests | |
- name: Download OpenBIOS build | |
uses: actions/download-artifact@v3 | |
with: | |
name: OpenBIOS | |
- name: Download mips tests | |
uses: actions/download-artifact@v3 | |
with: | |
name: tests | |
- name: Bundle | |
run: ./.github/scripts/create-app.sh | |
- name: Create BUILD environment | |
run: echo "BUILD=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Injecting OpenBIOS | |
run: cp openbios.bin PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources | |
- name: Packaging | |
run: | | |
echo '{' > PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "version": "'`git rev-parse HEAD | cut -c 1-8`'",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "changeset": "'`git rev-parse HEAD`'",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "timestamp": '`date '+%s'`',' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "channel": "dev",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "updateInfo": [' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' {' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "channel": "dev",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "method": "appcenter",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "updateCatalog": "https://install.appcenter.ms/api/v0.1/apps/grumpycoders/pcsx-redux-macos/distribution_groups/public/public_releases",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' "updateInfoBase": "https://install.appcenter.ms/api/v0.1/apps/grumpycoders/pcsx-redux-macos/distribution_groups/public/releases/"' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' }' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo ' ]' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
echo '}' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json | |
- name: Signing Application | |
run: codesign --force -s - -vvvv PCSX-Redux.app | |
- name: Adjusting for dmg folder | |
run: | | |
mkdir dmgdir | |
mv PCSX-Redux.app dmgdir | |
cp dmgdir/PCSX-Redux.app/Contents/Resources/AppIcon.icns . | |
- name: Creating dmg icon | |
run: | | |
sips -i AppIcon.icns | |
DeRez -only icns AppIcon.icns > icns.rsrc | |
cp AppIcon.icns dmgdir/.VolumeIcon.icns | |
SetFile -c icnC dmgdir/.VolumeIcon.icns | |
SetFile -a C dmgdir | |
- name: Creating Application link | |
run: ln -s /Applications dmgdir | |
- name: Creating dmg file | |
run: hdiutil create -volname PCSX-Redux-$BUILD -srcfolder dmgdir -ov -format UDZO PCSX-Redux-$BUILD.dmg | |
- name: Applying icon to dmg file | |
run: | | |
Rez -append icns.rsrc -o PCSX-Redux-$BUILD.dmg | |
SetFile -a C PCSX-Redux-$BUILD.dmg | |
- name: Removing temporary dmg folder | |
run: rm -rf dmgdir | |
- name: Upload DMG | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Dmg | |
path: '**/*.dmg' | |
publish-app: | |
runs-on: ubuntu-latest | |
needs: macos-build-and-test | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: n1hility/cancel-previous-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
- name: Install appcenter | |
run: npm install -g appcenter-cli | |
- name: Create BUILD environment | |
run: echo "BUILD=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Download DMG | |
uses: actions/download-artifact@v2 | |
with: | |
name: Dmg | |
- name: Distribute app | |
env: | |
APPCENTER_ACCESS_TOKEN: ${{ secrets.MACOS_APPCENTER_ACCESS_TOKEN }} | |
run: appcenter distribute release -n 0 -b $BUILD -f PCSX-Redux-$BUILD.dmg -g 'Public' -a grumpycoders/pcsx-redux-macos --disable-telemetry |