Skip to content

Commit

Permalink
chore(dev): GitHub Actions matrix correction
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed May 17, 2024
1 parent 2d9cca7 commit 5c328a9
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,39 @@ jobs:
# runs-on: ubuntu-latest # / ubuntu-18.04 ... or ubuntu-16.04, ubuntu-20.04
# runs-on: macos-latest # / macos-10.15
# runs-on: windows-2016 # not window-latest / windows-2019, see https://github.com/edrlab/thorium-reader/issues/1591
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.runson }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-13, macos-latest, ubuntu-20.04]
# windows-arm
osarch: [windows-intel, macos-intel, macos-arm, linux-intel, linux-arm]
include:
- os: windows-latest
osname: windows
- osarch: windows-intel
runson: windows-latest
packname: win
release_tag: latest-windows
- os: macos-13
osname: macos-intel
release_tag: latest-windows-intel
# - osarch: windows-arm
# runson: windows-latest
# packname: win
# release_tag: latest-windows-arm
- osarch: macos-intel
runson: macos-13
packname: 'mac:skip-notarize'
release_tag: latest-macos-intel
- os: macos-latest
osname: macos-arm
- osarch: macos-arm
runson: macos-latest
packname: 'mac:skip-notarize'
release_tag: latest-macos-arm
- os: ubuntu-20.04
osname: linux-intel
- osarch: linux-intel
runson: ubuntu-20.04
packname: linux
release_tag: latest-linux-intel
- os: ubuntu-20.04
osname: linux-arm
- osarch: linux-arm
runson: ubuntu-20.04
packname: linux
release_tag: latest-linux-arm
env:
# OS_NAME_: ${{ matrix.osname }}
# OS_NAME_: ${{ matrix.osarch }}
RELEASE_TAG: ${{ matrix.release_tag }}
steps:
# - run: echo 'OS_NAME_:' ${{ env.OS_NAME_ }}
Expand All @@ -73,8 +78,8 @@ jobs:
- run: 'echo "GITHUB_RUN_ID: ${{ github.run_id }}"'
- run: 'echo "GITHUB_SHA: ${{ github.sha }}"'
- name: Check sys arch
if: ${{ matrix.osname != 'windows' }}
run: echo "${{ matrix.osname }}" && uname -m && arch
if: ${{ matrix.osarch != 'windows-intel' }}
run: echo "${{ matrix.osarch }}" && uname -m && arch
- name: Checkout
uses: actions/checkout@v4
# with:
Expand Down Expand Up @@ -142,11 +147,11 @@ jobs:
run: npm run build:prod
# && npm run test SEE https://github.com/edrlab/thorium-reader/issues/1697
- name: non-PR action, Windows (build and package)
if: ${{ github.event_name != 'pull_request' && matrix.osname == 'windows' }}
if: ${{ github.event_name != 'pull_request' && ( matrix.osarch == 'windows-intel' || matrix.osarch == 'windows-arm' ) }}
run: npm run package:${{ matrix.packname }}
- name: non-PR action, non-Windows (build and package)
if: ${{ github.event_name != 'pull_request' && matrix.osname != 'windows' }}
run: echo "${{ matrix.osname }}" && (if [[ ${{ matrix.osname }} == 'macos-arm' || ${{ matrix.osname }} == 'linux-arm' ]]; then uname -m && arch && sed 's/x64/arm64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json && npm run package:${{ matrix.packname }} && sed 's/arm64/x64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json; else npm run package:${{ matrix.packname }}; fi)
if: ${{ github.event_name != 'pull_request' && matrix.osarch != 'windows-intel' && matrix.osarch != 'windows-arm' }}
run: echo "${{ matrix.osarch }}" && (if [[ ${{ matrix.osarch }} == 'macos-arm' || ${{ matrix.osarch }} == 'linux-arm' ]]; then uname -m && arch && sed 's/x64/arm64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json && npm run package:${{ matrix.packname }} && sed 's/arm64/x64/g' ./package.json > ./package.json.new && mv ./package.json.new ./package.json; else npm run package:${{ matrix.packname }}; fi)
#- run: ls -alsR release
#- run: npm install @octokit/rest
- name: GitHub Tagged Release Delete/ReCreate and Upload Build Artefacts
Expand Down

1 comment on commit 5c328a9

@reyis1903
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git comit

Please sign in to comment.