summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/downloader.yml
blob: 159a333c1840d6aba4ef130a3750a48ed3d7914a (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
---
name: Installer downloader - Size test
on:
  pull_request:
    paths:
      - '**'
      - '!**/**.md'
      - '!.github/workflows/**'
      - '.github/workflows/downloader.yml'
      - '!.github/CODEOWNERS'
      - '!android/**'
      - '!audits/**'
      - '!build.sh'
      - '!ci/**'
      - '!clippy.toml'
      - '!deny.toml'
      - '!rustfmt.toml'
      - '!.yamllint'
      - '!docs/**'
      - '!graphics/**'
      - '!desktop/**'
      - '!ios/**'
      - '!scripts/**'
      - '!.*ignore'
      - '!prepare-release.sh'
      - '!**/osv-scanner.toml'

permissions: {}

jobs:
  build-windows:
    strategy:
      matrix:
        config:
          - os: windows-latest
            arch: x64
    runs-on: ${{ matrix.config.os }}
    env:
      # If the file is larger than this, a regression has probably been introduced.
      # You should think twice before increasing this limit.
      MAX_BINARY_SIZE: 2621440
    steps:
      # By default, the longest path a filename can have in git on Windows is 260 character.
      - name: Set git config for long paths
        run: |
          git config --system core.longpaths true

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

      - name: Build
        shell: bash
        env:
          # On Windows, the checkout is on the D drive, which is very small.
          # Moving the target directory to the C drive ensures that the runner
          # doesn't run out of space on the D drive.
          CARGO_TARGET_DIR: "C:/cargo-target"
        run: ./installer-downloader/build.sh

      - name: Check file size
        uses: ./.github/actions/check-file-size
        with:
          artifact: "./dist/Install Mullvad VPN.exe"
          max_size: ${{ env.MAX_BINARY_SIZE }}

  build-macos:
    runs-on: macos-latest
    env:
      # If the file is larger than this, a regression has probably been introduced.
      # You should think twice before increasing this limit.
      MAX_BINARY_SIZE: 3225000
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust
        run: rustup target add x86_64-apple-darwin

      - name: Build
        run: ./installer-downloader/build.sh

      - name: Check file size
        uses: ./.github/actions/check-file-size
        with:
          artifact: "./dist/Install Mullvad VPN.dmg"
          max_size: ${{ env.MAX_BINARY_SIZE }}