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