|
| 1 | +name: Build packages for macOS |
| 2 | + |
| 3 | +inputs: |
| 4 | + architecture: |
| 5 | + required: true |
| 6 | + description: "The name of the architecture to build the macOS package for." |
| 7 | + package-file-name-prefix: |
| 8 | + required: true |
| 9 | + description: "The prefix for the macOS package file name." |
| 10 | + backend-artifact-name-prefix: |
| 11 | + required: true |
| 12 | + description: "The prefix for the macOS backend artifact name." |
| 13 | + |
| 14 | +runs: |
| 15 | + using: "composite" |
| 16 | + steps: |
| 17 | + - name: Download macOS-${{ inputs.architecture }} backend file |
| 18 | + uses: actions/download-artifact@v8 |
| 19 | + with: |
| 20 | + name: ${{ inputs.backend-artifact-name-prefix }}-macos-${{ inputs.architecture }} |
| 21 | + path: ${{ runner.temp }}/backend |
| 22 | + |
| 23 | + - name: Download linux-amd64 packaged files |
| 24 | + uses: actions/download-artifact@v8 |
| 25 | + with: |
| 26 | + name: ${{ inputs.package-file-name-prefix }}-linux-amd64.tar.gz |
| 27 | + path: ${{ runner.temp }}/package |
| 28 | + |
| 29 | + - name: Extract frontend files from linux-amd64 package |
| 30 | + shell: bash |
| 31 | + run: | |
| 32 | + mkdir -p package |
| 33 | + tar -xzf ${{ runner.temp }}/package/${{ inputs.package-file-name-prefix }}-linux-amd64.tar.gz -C package |
| 34 | +
|
| 35 | + - name: Package macOS-${{ inputs.architecture }} package |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + mkdir -p ezbookkeeping |
| 39 | + mkdir -p ezbookkeeping/data |
| 40 | + mkdir -p ezbookkeeping/storage |
| 41 | + mkdir -p ezbookkeeping/log |
| 42 | + cp ${{ runner.temp }}/backend/ezbookkeeping ezbookkeeping/ |
| 43 | + cp -R package/public ezbookkeeping/public |
| 44 | + cp -R conf ezbookkeeping/conf |
| 45 | + cp -R templates ezbookkeeping/templates |
| 46 | + cp LICENSE ezbookkeeping/ |
| 47 | + cd ezbookkeeping |
| 48 | + chmod +x ezbookkeeping |
| 49 | + tar -czf ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-macos-${{ inputs.architecture }}.tar.gz * |
| 50 | + cd .. |
| 51 | + rm -rf ezbookkeeping |
| 52 | +
|
| 53 | + - name: Upload macOS-${{ inputs.architecture }} artifact |
| 54 | + uses: actions/upload-artifact@v7 |
| 55 | + with: |
| 56 | + archive: false |
| 57 | + path: ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-macos-${{ inputs.architecture }}.tar.gz |
| 58 | + if-no-files-found: error |
0 commit comments