|
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - "v*" |
| 7 | + branches: |
| 8 | + - main |
| 9 | + - rc |
| 10 | + - beta |
| 11 | + - nightly |
| 12 | + - hotfix |
| 13 | + - "*.x" |
7 | 14 |
|
8 | 15 | jobs: |
9 | 16 | build: |
10 | 17 | name: Build |
11 | 18 | strategy: |
12 | 19 | fail-fast: false |
13 | 20 | matrix: |
14 | | - target: [ windows, linux, macos] |
| 21 | + target: [windows, linux, macos] |
15 | 22 | include: |
16 | 23 | - target: windows |
17 | 24 | runner: windows-latest |
18 | | - channel: 'beta' |
| 25 | + channel: "beta" |
19 | 26 | artifact: build/windows/x64/runner/Release |
20 | 27 | - target: linux |
21 | 28 | runner: ubuntu-latest |
22 | | - channel: 'stable' |
| 29 | + channel: "stable" |
23 | 30 | artifact: build/linux/x64/release/bundle |
24 | 31 | - target: macos |
25 | 32 | runner: macos-latest |
26 | | - channel: 'stable' |
| 33 | + channel: "stable" |
27 | 34 | artifact: "build/macos/Build/Products/Release/Past Paper Master.app" |
28 | 35 | runs-on: ${{ matrix.runner }} |
29 | 36 | environment: ${{ github.ref_name }} |
30 | 37 | timeout-minutes: 20 |
31 | 38 | steps: |
32 | | - - name: Checkout |
33 | | - uses: actions/checkout@v3 |
34 | | - |
35 | | - - name: set version number (unix) |
36 | | - run: echo "VERSION_NUM=$(echo ${{ github.ref }} | cut -d / -f 3)" >> $GITHUB_ENV |
37 | | - if: ${{ matrix.runner == 'ubuntu-latest' }} or ${{ matrix.runner == 'macos-latest' }} |
38 | | - - name: set version number (windows) |
39 | | - run: echo "VERSION_NUM=$(Split-Path -Leaf ${{ github.ref }})" >> $env:GITHUB_ENV |
40 | | - if: ${{ matrix.runner == 'windows-latest' }} |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
41 | 41 |
|
42 | | - - name: Install Flutter |
43 | | - uses: subosito/flutter-action@v2.10.0 |
44 | | - with: |
45 | | - channel: ${{ matrix.channel }} |
46 | | - cache: true |
47 | | - cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache |
48 | | - cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path |
49 | | - architecture: x64 # action no current support for arm64 |
| 42 | + - name: set version number (unix) |
| 43 | + if: ${{ github.event_name == 'tags' }} and ${{ matrix.runner != 'windows-latest' }} |
| 44 | + run: echo "VERSION_NUM=$(echo ${{ github.ref }} | cut -d / -f 3)" >> $GITHUB_ENV |
| 45 | + - name: set version number (windows) |
| 46 | + if: ${{ github.event_name == 'tags' }} and ${{ matrix.runner == 'windows-latest' }} |
| 47 | + run: echo "VERSION_NUM=$(Split-Path -Leaf ${{ github.ref }})" >> $env:GITHUB_ENV |
50 | 48 |
|
51 | | - - name: Install Dependencies (windows) |
52 | | - if: ${{ matrix.runner == 'windows-latest' }} |
53 | | - run: | |
54 | | - flutter config --enable-windows-desktop |
55 | | - - name: Install Dependencies (linux) |
56 | | - if: ${{ matrix.runner == 'ubuntu-latest' }} |
57 | | - run: | |
58 | | - sudo apt-get update -y |
59 | | - sudo apt-get install -y ninja-build libgtk-3-dev |
60 | | - flutter config --enable-linux-desktop |
61 | | - - name: Install Dependencies (macos) |
62 | | - if: ${{ matrix.runner == 'macos-latest' }} |
63 | | - run: | |
64 | | - flutter config --enable-macos-desktop |
| 49 | + - name: Install Flutter |
| 50 | + uses: subosito/flutter-action@v2.13.0 |
| 51 | + with: |
| 52 | + channel: ${{ matrix.channel }} |
| 53 | + cache: true |
65 | 54 |
|
66 | | - - name: Build Flutter ${{ matrix.target }} |
67 | | - run: | |
68 | | - make build ${{ matrix.target }} |
| 55 | + - name: Install Dependencies (windows) |
| 56 | + if: ${{ matrix.runner == 'windows-latest' }} |
| 57 | + run: | |
| 58 | + flutter config --enable-windows-desktop |
| 59 | + - name: Install Dependencies (linux) |
| 60 | + if: ${{ matrix.runner == 'ubuntu-latest' }} |
| 61 | + run: | |
| 62 | + sudo apt-get update -y |
| 63 | + sudo apt-get install -y ninja-build libgtk-3-dev |
| 64 | + flutter config --enable-linux-desktop |
| 65 | + - name: Install Dependencies (macos) |
| 66 | + if: ${{ matrix.runner == 'macos-latest' }} |
| 67 | + run: | |
| 68 | + flutter config --enable-macos-desktop |
69 | 69 |
|
70 | | - - name: Zip artifact (Windows) |
71 | | - if: ${{ matrix.runner == 'windows-latest' }} |
72 | | - shell: pwsh |
73 | | - run: Compress-Archive "${{ matrix.artifact }}" "ppm-${{ matrix.target }}-$Env:VERSION_NUM.zip" |
74 | | - - name: Zip artifact (Linux) |
75 | | - if: ${{ matrix.runner == 'ubuntu-latest' }} |
76 | | - shell: bash |
77 | | - run: tar -C "$(dirname ${{ matrix.artifact }})" -czf "ppm-${{ matrix.target }}-${VERSION_NUM}.tar.gz" "$(basename ${{ matrix.artifact }})" --transform "s/$(basename ${{ matrix.artifact }})/PastPaperMaster/" |
78 | | - - name: Zip artifact (MacOS) |
79 | | - if: ${{ matrix.runner == 'macos-latest' }} |
80 | | - shell: bash |
81 | | - run: tar -C "$(dirname "${{ matrix.artifact }}")" -czf "ppm-${{ matrix.target }}-${VERSION_NUM}.tar.gz" "$(basename "${{ matrix.artifact }}")" |
| 70 | + - name: Build Flutter ${{ matrix.target }} |
| 71 | + run: | |
| 72 | + make build ${{ matrix.target }} |
82 | 73 |
|
83 | | - - name: Upload artifact |
84 | | - uses: actions/upload-artifact@v3 |
85 | | - with: |
86 | | - name: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }} |
87 | | - path: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }}.* |
88 | | - - uses: ncipollo/release-action@v1 |
89 | | - with: |
90 | | - artifacts: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }}.* |
91 | | - token: ${{ secrets.GITHUB_TOKEN }} |
92 | | - allowUpdates: true |
93 | | - draft: true |
94 | | - bodyFile: ".github/docs/release-notes.md" |
| 74 | + - name: Zip artifact (Windows) |
| 75 | + if: ${{ matrix.runner == 'windows-latest' }} |
| 76 | + shell: pwsh |
| 77 | + run: Compress-Archive "${{ matrix.artifact }}" "ppm-${{ matrix.target }}-$Env:VERSION_NUM.zip" |
| 78 | + - name: Zip artifact (Linux) |
| 79 | + if: ${{ matrix.runner == 'ubuntu-latest' }} |
| 80 | + shell: bash |
| 81 | + run: tar -C "$(dirname ${{ matrix.artifact }})" -czf "ppm-${{ matrix.target }}-${VERSION_NUM}.tar.gz" "$(basename ${{ matrix.artifact }})" --transform "s/$(basename ${{ matrix.artifact }})/PastPaperMaster/" |
| 82 | + - name: Zip artifact (MacOS) |
| 83 | + if: ${{ matrix.runner == 'macos-latest' }} |
| 84 | + shell: bash |
| 85 | + run: brew install create-dmg && create-dmg --icon "Past Paper Master.app" 200 190 --app-drop-link 600 185 --volname "PastPaperMaster" "ppm-${{ matrix.target }}-${VERSION_NUM}.dmg" "${{ matrix.artifact }}" |
| 86 | + |
| 87 | + - name: Upload artifact |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }} |
| 91 | + path: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }}.* |
| 92 | + |
| 93 | + - uses: ncipollo/release-action@v1 |
| 94 | + if: ${{ github.event_name == 'tags' }} |
| 95 | + with: |
| 96 | + artifacts: ppm-${{ matrix.target }}-${{ env.VERSION_NUM }}.* |
| 97 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + allowUpdates: true |
| 99 | + draft: true |
| 100 | + bodyFile: ".github/docs/release-notes.md" |
0 commit comments