|
| 1 | +name: Arduino IDE ARM64 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - '[0-9]+.[0-9]+.x' |
| 8 | + paths-ignore: |
| 9 | + - '.github/**' |
| 10 | + - '!.github/workflows/buildarm.yml' |
| 11 | + - '.vscode/**' |
| 12 | + - 'docs/**' |
| 13 | + - 'scripts/**' |
| 14 | + - '!scripts/merge-channel-files.js' |
| 15 | + - 'static/**' |
| 16 | + - '*.md' |
| 17 | + tags: |
| 18 | + - '[0-9]+.[0-9]+.[0-9]+*' |
| 19 | + workflow_dispatch: |
| 20 | + inputs: |
| 21 | + paid-runners: |
| 22 | + description: Include builds on non-free runners |
| 23 | + type: boolean |
| 24 | + default: false |
| 25 | + pull_request: |
| 26 | + paths-ignore: |
| 27 | + - '.github/**' |
| 28 | + - '!.github/workflows/buildarm.yml' |
| 29 | + - '.vscode/**' |
| 30 | + - 'docs/**' |
| 31 | + - 'scripts/**' |
| 32 | + - '!scripts/merge-channel-files.js' |
| 33 | + - 'static/**' |
| 34 | + - '*.md' |
| 35 | + |
| 36 | +env: |
| 37 | + GO_VERSION: '1.21' |
| 38 | + NODE_VERSION: '18.17' |
| 39 | + YARN_VERSION: '1.22' |
| 40 | + JOB_TRANSFER_ARTIFACT_PREFIX: buildarm-artifacts- |
| 41 | + BASE_BUILD_DATA: | |
| 42 | + - config: |
| 43 | + name: Linux ARM64 |
| 44 | + runs-on: [self-hosted, arm64-runner] |
| 45 | + container: | |
| 46 | + null |
| 47 | + job-transfer-artifact-suffix: Linux_arm64 |
| 48 | + mergeable-channel-file: 'false' |
| 49 | + artifacts: |
| 50 | + - path: '*Linux_arm64.zip' |
| 51 | + name: Linux_ARM64_zip |
| 52 | + - path: '*Linux_arm64.AppImage' |
| 53 | + name: Linux_ARM64_app_image |
| 54 | +
|
| 55 | +jobs: |
| 56 | + run-determination: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + outputs: |
| 59 | + result: ${{ steps.determination.outputs.result }} |
| 60 | + permissions: {} |
| 61 | + steps: |
| 62 | + - name: Determine if the rest of the workflow should run |
| 63 | + id: determination |
| 64 | + run: | |
| 65 | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" |
| 66 | + if [[ |
| 67 | + "${{ github.event_name }}" != "create" || |
| 68 | + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX |
| 69 | + ]]; then |
| 70 | + RESULT="true" |
| 71 | + else |
| 72 | + RESULT="false" |
| 73 | + fi |
| 74 | + echo "result=$RESULT" >> $GITHUB_OUTPUT |
| 75 | +
|
| 76 | + build: |
| 77 | + name: build (${{ matrix.config.name }}) |
| 78 | + needs: run-determination |
| 79 | + env: |
| 80 | + BUILD_ARTIFACTS_PATH: electron-app/dist/build-artifacts |
| 81 | + strategy: |
| 82 | + matrix: |
| 83 | + config: ${{ fromJson(env.BASE_BUILD_DATA) }} |
| 84 | + runs-on: ${{ matrix.config.runs-on }} |
| 85 | + container: ${{ fromJSON(matrix.config.container) }} |
| 86 | + steps: |
| 87 | + - name: Checkout |
| 88 | + uses: actions/checkout@v4 |
| 89 | + |
| 90 | + - name: Install Node.js |
| 91 | + uses: actions/setup-node@v4 |
| 92 | + with: |
| 93 | + node-version: ${{ env.NODE_VERSION }} |
| 94 | + registry-url: 'https://registry.npmjs.org' |
| 95 | + |
| 96 | + - name: Install Yarn |
| 97 | + run: | |
| 98 | + npm install --global "yarn@${{ env.YARN_VERSION }}" |
| 99 | +
|
| 100 | + - name: Install Python 3.x |
| 101 | + uses: actions/setup-python@v5 |
| 102 | + with: |
| 103 | + python-version: '3.11.x' |
| 104 | + |
| 105 | + - name: Install Go |
| 106 | + uses: actions/setup-go@v5 |
| 107 | + with: |
| 108 | + go-version: ${{ env.GO_VERSION }} |
| 109 | + |
| 110 | + - name: Install Taskfile |
| 111 | + uses: arduino/setup-task@v2 |
| 112 | + with: |
| 113 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + version: 3.x |
| 115 | + |
| 116 | + - name: Package |
| 117 | + env: |
| 118 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 119 | + run: | |
| 120 | + yarn install |
| 121 | + yarn --cwd arduino-ide-extension build |
| 122 | + yarn --cwd electron-app rebuild |
| 123 | + yarn --cwd electron-app build |
| 124 | + yarn --cwd electron-app package |
| 125 | +
|
| 126 | + - name: Upload builds to job transfer artifact |
| 127 | + uses: actions/upload-artifact@v4 |
| 128 | + with: |
| 129 | + name: ${{ env.JOB_TRANSFER_ARTIFACT_PREFIX }}${{ matrix.config.job-transfer-artifact-suffix }} |
| 130 | + path: ${{ env.BUILD_ARTIFACTS_PATH }} |
0 commit comments