Skip to content

test release

test release #39

Workflow file for this run

name: Deploy React App with GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Build React app
run: npm run build:react
- name: Bundle the app with Webpack
run: npm run build:bundle
- name: List files in the build directory
run: ls -l ./build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: ./build
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: github-pages
- name: List files after download
run: ls -l
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
build-electron:
needs: deploy
runs-on: ubuntu-latest
strategy:
matrix:
platform: [win]
# platform: [win, mac, linux]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Build Electron App
run: |
case ${{ matrix.platform }} in
win) npm run dist -- --win ;;
mac) npm run dist -- --mac ;;
linux) npm run dist -- --linux AppImage ;;
esac
- name: Archive Build Outputs
run: |
mkdir -p artifacts
case ${{ matrix.platform }} in
win) mv dist/*.exe artifacts/ ;;
mac) mv dist/*.dmg artifacts/ ;;
linux) mv dist/*.AppImage artifacts/ ;;
esac
- name: Upload Build Outputs
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.platform }}-builds
path: artifacts
release:
needs: build-electron
runs-on: ubuntu-latest
strategy:
matrix:
platform: [win]
# platform: [win, mac, linux]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: ${{ matrix.platform }}-builds
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
token: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
- name: Upload Windows Installer
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/*.exe
asset_name: TxCRCPME-win-v${{ github.run_number }}.exe
asset_content_type: application/octet-stream
# - name: Upload macOS Installer
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./artifacts/*.dmg
# asset_name: TxCRCPME-mac-v${{ github.run_number }}.dmg
# asset_content_type: application/octet-stream
# - name: Upload Linux Installer
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./artifacts/*.AppImage
# asset_name: TxCRCPME-linux-v${{ github.run_number }}.AppImage
# asset_content_type: application/octet-stream