|
| 1 | +name: Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - early |
| 7 | + |
| 8 | +jobs: |
| 9 | + publish-linux: |
| 10 | + # To enable auto publishing to github, update your electron publisher |
| 11 | + # config in package.json > "build" and remove the conditional below |
| 12 | + #if: ${{ github.repository_owner == 'electron-react-boilerplate' }} |
| 13 | + |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest] |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout git repo |
| 22 | + uses: actions/checkout@v3 |
| 23 | + |
| 24 | + - name: Git Submodule Update |
| 25 | + run: git submodule update --init --recursive |
| 26 | + |
| 27 | + - name: Use cached node_modules |
| 28 | + id: cache-node_modules |
| 29 | + uses: actions/cache@v3 |
| 30 | + with: |
| 31 | + path: node_modules |
| 32 | + key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} |
| 33 | + |
| 34 | + - name: Install Node and NPM |
| 35 | + uses: actions/setup-node@v3 |
| 36 | + with: |
| 37 | + node-version-file: .nvmrc |
| 38 | + cache: npm |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + if: steps.cache-node_modules.outputs.cache-hit != 'true' |
| 42 | + run: npm ci |
| 43 | + |
| 44 | + - name: Set Early Build |
| 45 | + run: | |
| 46 | + sed -i "s|main|early|g" "./src/data/branch.json" |
| 47 | + sed -i "s|emudeck-electron|emudeck-electron-early|g" "./package.json" |
| 48 | + #sed -i "s|EmuDeck|EmuDeck-early|g" "./release/app/package.json" |
| 49 | + #sed -i 's|"productName": "EmuDeck"|"productName": "EmuDeck-early"|g' "./package.json" |
| 50 | +
|
| 51 | + - name: Publish releases |
| 52 | + env: |
| 53 | + # These values are used for auto updates signing |
| 54 | + #APPLE_ID: ${{ secrets.APPLE_ID }} |
| 55 | + #APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }} |
| 56 | + #CSC_LINK: ${{ secrets.CSC_LINK }} |
| 57 | + #CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} |
| 58 | + # This is used for uploading release assets to github |
| 59 | + #npm run build:${GITHUB_REF##*/} -> Branch name |
| 60 | + #npm exec electron-builder -- --publish always --linux --win |
| 61 | + GH_TOKEN: ${{ secrets.github_token }} |
| 62 | + run: | |
| 63 | + npm run postinstall |
| 64 | + npm run build |
| 65 | + npm exec electron-builder -- --publish always --linux |
| 66 | +
|
| 67 | + - name: Upload Artifact |
| 68 | + uses: actions/upload-artifact@v3 |
| 69 | + with: |
| 70 | + name: EmuDeck-Early-AppImage |
| 71 | + path: '**/*.AppImage' |
| 72 | + |
| 73 | + publish-windows: |
| 74 | + # To enable auto publishing to github, update your electron publisher |
| 75 | + # config in package.json > "build" and remove the conditional below |
| 76 | + #if: ${{ github.repository_owner == 'electron-react-boilerplate' }} |
| 77 | + |
| 78 | + runs-on: ${{ matrix.os }} |
| 79 | + |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + os: [macOS-latest] |
| 83 | + |
| 84 | + steps: |
| 85 | + - name: Checkout git repo |
| 86 | + uses: actions/checkout@v3 |
| 87 | + |
| 88 | + - name: Git Submodule Update |
| 89 | + run: git submodule update --init --recursive |
| 90 | + |
| 91 | + - name: Use cached node_modules |
| 92 | + id: cache-node_modules |
| 93 | + uses: actions/cache@v3 |
| 94 | + with: |
| 95 | + path: node_modules |
| 96 | + key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }} |
| 97 | + |
| 98 | + - name: Install Node and NPM |
| 99 | + uses: actions/setup-node@v3 |
| 100 | + with: |
| 101 | + node-version-file: .nvmrc |
| 102 | + cache: npm |
| 103 | + |
| 104 | + - name: Install dependencies |
| 105 | + if: steps.cache-node_modules.outputs.cache-hit != 'true' |
| 106 | + run: npm ci |
| 107 | + |
| 108 | + - name: Set Early Build |
| 109 | + run: | |
| 110 | + sed -i'.original' -e "s|main|early|g" "./src/data/branch.json" |
| 111 | + sed -i'.original' -e "s|emudeck-electron|emudeck-electron-early|g" "./package.json" |
| 112 | + #sed -i'.original' -e "s|EmuDeck|EmuDeck-early|g" "./release/app/package.json" |
| 113 | + #sed -i'.original' -e 's|"productName": "EmuDeck"|"productName": "EmuDeck-early"|g' "./package.json" |
| 114 | + - name: Publish releases |
| 115 | + env: |
| 116 | + # These values are used for auto updates signing |
| 117 | + #APPLE_ID: ${{ secrets.APPLE_ID }} |
| 118 | + #APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }} |
| 119 | + #CSC_LINK: ${{ secrets.CSC_LINK }} |
| 120 | + #CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} |
| 121 | + # This is used for uploading release assets to github |
| 122 | + #npm run build:${GITHUB_REF##*/} -> Branch name |
| 123 | + #npm exec electron-builder -- --publish always --linux --win |
| 124 | + GH_TOKEN: ${{ secrets.github_token }} |
| 125 | + run: | |
| 126 | + npm run postinstall |
| 127 | + npm run build |
| 128 | + npm exec electron-builder -- --publish always --win |
0 commit comments