aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/release.yaml
blob: 4fbdbcd44ddc110d3d66b41554efe6bacb89305c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Release

on:
    workflow_dispatch:

# a lot of this isnt necessary but i'm designing ahead for tauri integration
jobs:
    desktop-main:
        strategy:
            matrix:
                settings:
                    - host: macos-latest
                      target: x86_64-apple-darwin
                      bundles: app,dmg
                      os: darwin
                      arch: x86_64
                    - host: macos-latest
                      target: aarch64-apple-darwin
                      bundles: app,dmg
                      os: darwin
                      arch: aarch64
                    - host: windows-latest
                      target: x86_64-pc-windows-msvc
                      bundles: msi
                      os: windows
                      arch: x86_64
                    - host: ubuntu-20.04
                      target: x86_64-unknown-linux-gnu
                      bundles: deb,appimage
                      os: linux
                      arch: x86_64
        name: Desktop - Main ${{ matrix.settings.target }}
        runs-on: ${{ matrix.settings.host }}
        steps:
            - name: Maximize build space
              if: ${{ runner.os == 'Linux' }}
              uses: easimon/maximize-build-space@master
              with:
                  swap-size-mb: 3072
                  root-reserve-mb: 6144
                  remove-dotnet: 'true'
                  remove-codeql: 'true'
                  remove-haskell: 'true'
                  remove-docker-images: 'true'

            - name: Checkout repository
              uses: actions/checkout@v3

            - name: Symlink target to C:\
              if: ${{ runner.os == 'Windows' }}
              shell: powershell
              run: |
                  New-Item -ItemType Directory -Force -Path C:\nexus_target
                  New-Item -Path target -ItemType Junction -Value C:\nexus_target

            - name: Remove 32-bit libs
              if: ${{ runner.os == 'Linux' }}
              run: |
                  dpkg -l | grep i386
                  sudo apt-get purge --allow-remove-essential libc6-i386 ".*:i386"
                  sudo dpkg --remove-architecture i386

            - name: Setup System and Rust
              uses: ./.github/actions/setup-system
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
                  target: ${{ matrix.settings.target }}

            - name: Setup Node.js, pnpm and dependencies
              uses: ./.github/actions/setup-pnpm
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}

            - name: Build
              run: |
                  pnpm tauri build --ci -v --target ${{ matrix.settings.target }} --bundles ${{ matrix.settings.bundles }},updater

              # this doesnt work rn so just uhh dont use it lol
            - name: Publish Artifacts
              uses: ./.github/actions/publish-artifacts
              with:
                  os: ${{ matrix.settings.os }}
                  arch: ${{ matrix.settings.arch }}
                  target: ${{ matrix.settings.target }}
                  profile: release

    release:
        if: startsWith(github.ref, 'refs/tags/')
        runs-on: ubuntu-latest
        name: Create Release
        needs: desktop-main
        permissions:
            contents: write
        steps:
            - name: Download artifacts
              uses: actions/download-artifact@v3

            - name: Create Release
              uses: softprops/action-gh-release@v1
              with:
                  draft: true
                  files: '*/**'