-6

I need to run a GitHub action with macOS and the GCC compiler within.

I tried with:

name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
    version: latest
    platform: x64

But it doesn't work on macOS. How can I do it?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JJB
  • 202
  • 4
  • 11
  • 4
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 04 '21 at 13:13

1 Answers1

-4

I solved it with this new job:

    name: Build and push native library on ${{ matrix.os }} ${{ matrix.architecture }}
    strategy:
      fail-fast: true
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
        java: [15]
        architecture: [x86, x64]
        exclude:
          - os: macOS-latest
            architecture: x86
    runs-on: ${{ matrix.os }}
    steps:
      - name: Set up JDK ${{ matrix.java }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.java }}
          architecture: ${{ matrix.architecture }}
      - uses: actions/checkout@v2
      - if: startsWith(matrix.os, 'ubuntu') == true
        name: Change the permissions of the build script of external classes
        run: chmod +x ./java/src/main/resources/compileExternalClasses.sh
      - name: Build and push native library
        run: |
          mvn -B clean package -DskipTests=true --file ./native/pom.xml
          git config user.name "${{ github.event.head_commit.committer.name }}"
          git config user.email "${{ github.event.head_commit.committer.email }}"
          git pull origin experimental
          git commit -am "Generated library for ${{ matrix.os }} ${{ matrix.architecture }}" --allow-empty
          git push
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JJB
  • 202
  • 4
  • 11
  • 6
    Please add further details to expand on your answer, such as working code or documentation citations. – Community Aug 31 '21 at 08:21
  • Unfortunately I don't have time to do this, you can still delete my question – JJB Aug 31 '21 at 09:33
  • 5
    Re *"I don't have time to do this"*: You don't have to do it immediately. Take your time, and do it within, say, 4 weeks. Make it an awesome outstanding answer. – Peter Mortensen Sep 19 '21 at 11:29