|
1 | 1 | name: Release |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | tags: |
5 | 6 | - 'v*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
6 | 11 | env: |
7 | 12 | CARGO_TERM_COLOR: always |
| 13 | + |
8 | 14 | jobs: |
9 | 15 | build: |
| 16 | + name: Build ${{ matrix.target }} |
10 | 17 | strategy: |
| 18 | + fail-fast: false |
11 | 19 | matrix: |
12 | 20 | include: |
13 | 21 | - os: ubuntu-latest |
14 | 22 | target: x86_64-unknown-linux-gnu |
15 | 23 | binary: lomux |
16 | 24 | archive: lomux-linux-x64.tar.gz |
| 25 | + |
17 | 26 | - os: windows-latest |
18 | 27 | target: x86_64-pc-windows-msvc |
19 | 28 | binary: lomux.exe |
20 | 29 | archive: lomux-windows-x64.zip |
| 30 | + |
21 | 31 | - os: macos-latest |
22 | 32 | target: x86_64-apple-darwin |
23 | 33 | binary: lomux |
24 | 34 | archive: lomux-macos-x64.tar.gz |
| 35 | + build_app_bundle: true |
| 36 | + |
25 | 37 | - os: macos-latest |
26 | 38 | target: aarch64-apple-darwin |
27 | 39 | binary: lomux |
28 | 40 | archive: lomux-macos-arm64.tar.gz |
| 41 | + |
29 | 42 | runs-on: ${{ matrix.os }} |
| 43 | + |
30 | 44 | steps: |
31 | 45 | - uses: actions/checkout@v4 |
| 46 | + |
32 | 47 | - uses: dtolnay/rust-toolchain@stable |
33 | 48 | with: |
34 | 49 | targets: ${{ matrix.target }} |
| 50 | + |
35 | 51 | - name: Install Linux deps |
36 | 52 | if: runner.os == 'Linux' |
37 | 53 | run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev |
| 54 | + |
38 | 55 | - name: Build |
39 | 56 | run: cargo build --release --target ${{ matrix.target }} |
40 | | - - name: Build Mac App Bundle |
41 | | - if: runner.os == 'macOS' && matrix.target == 'x86_64-apple-darwin' |
| 57 | + |
| 58 | + - name: Build macOS App Bundle |
| 59 | + if: ${{ matrix.build_app_bundle == true }} |
42 | 60 | run: | |
43 | 61 | cargo install cargo-bundle |
44 | 62 | cargo bundle --release |
45 | 63 | tar czf LoMux.app.tar.gz -C target/release/bundle/osx LoMux.app |
46 | | - - name: Archive Binary |
| 64 | +
|
| 65 | + - name: Archive binary |
| 66 | + shell: bash |
47 | 67 | run: | |
| 68 | + cd target/${{ matrix.target }}/release |
48 | 69 | if [ "${{ runner.os }}" = "Windows" ]; then |
49 | | - cd target/${{ matrix.target }}/release |
50 | 70 | 7z a ../../../${{ matrix.archive }} ${{ matrix.binary }} |
51 | 71 | else |
52 | | - cd target/${{ matrix.target }}/release |
53 | 72 | tar czf ../../../${{ matrix.archive }} ${{ matrix.binary }} |
54 | 73 | fi |
55 | | - shell: bash |
| 74 | +
|
56 | 75 | - uses: actions/upload-artifact@v4 |
57 | 76 | with: |
58 | 77 | name: ${{ matrix.archive }} |
59 | | - path: | |
60 | | - ${{ matrix.archive }} |
61 | | - LoMux.app.tar.gz |
| 78 | + path: ${{ matrix.archive }} |
| 79 | + |
| 80 | + - name: Upload macOS .app bundle |
| 81 | + if: ${{ matrix.build_app_bundle == true }} |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: LoMux.app |
| 85 | + path: LoMux.app.tar.gz |
| 86 | + |
62 | 87 | release: |
| 88 | + name: Create GitHub Release |
63 | 89 | needs: build |
64 | 90 | runs-on: ubuntu-latest |
65 | 91 | steps: |
66 | 92 | - uses: actions/download-artifact@v4 |
67 | 93 | with: |
68 | 94 | merge-multiple: true |
| 95 | + |
69 | 96 | - run: ls -laR |
70 | | - - uses: softprops/action-gh-release@v1 |
| 97 | + |
| 98 | + - name: Create GitHub Release |
| 99 | + uses: softprops/action-gh-release@v2 |
71 | 100 | with: |
| 101 | + tag_name: ${{ github.ref_name }} |
| 102 | + generate_release_notes: true |
72 | 103 | files: | |
73 | 104 | *.tar.gz |
74 | 105 | *.zip |
|
0 commit comments