aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/trigger_release.yml
blob: 5553884862175a51c156ae71e62e722ca2fc67f1 (plain) (blame)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Build Application and Make Release

on:
  push:
    tags: [ "*" ]

permissions:
  contents: write

jobs:
  source:
    runs-on: linux
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      - name: Pack
        run: ./.ci/source.sh
      - name: Upload
        uses: forgejo/upload-artifact@v4
        with:
          name: source.zip
          path: artifacts/

  windows:
    runs-on: windows
    strategy:
      matrix:
        target: ["msvc"] # TODO: Add msys2
    defaults:
      run:
        shell: ${{ (matrix.target == 'msys2' && 'msys2') || 'bash' }} {0}
    env:
      CCACHE_DIR: ${{ runner.workspace }}/.cache/.ccache
      CCACHE_COMPILERCHECK: content
      CCACHE_SLOPPINESS: time_macros
      OS: windows
      TARGET: ${{ matrix.target }}
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0
          fetch-tags: true

      - name: Set up vcpkg cache
        uses: actions/cache@v4
        with:
          path: |
            ${{ github.workspace }}/build/vcpkg_installed
            ${{ github.workspace }}/build/externals
            ${{ github.workspace }}/.vcpkg
          key: ${{ runner.os }}-${{ matrix.target }}-vcpkg-${{ hashFiles('**/CMakeLists.txt', '**/vcpkg.json') }}-${{ github.run_id }}
          restore-keys: |
            ${{ runner.os }}-${{ matrix.target }}-vcpkg-

      - name: Set up MSVC
        uses: https://github.com/ilammy/msvc-dev-cmd@v1
        if: ${{ matrix.target == 'msvc' }}

      - name: Cygwin with autoconf # NEEDED FOR LIBUSB
        shell: cmd
        run: ./.ci/windows/cygwin.bat

      - name: Configure & Build
        id: cmake
        shell: cmd
        run: ./.ci/windows/build-bqt.bat amd64 no

      - name: Package artifacts
        shell: powershell
        run: ./.ci/windows/package.ps1 amd64 no

      - name: Upload Windows artifacts
        uses: forgejo/upload-artifact@v4
        with:
          name: ${{ matrix.target }}.zip
          path: artifacts/*

  linux:
    runs-on: linux
    env:
      CCACHE_DIR: /home/runner/.cache/ccache
      CCACHE_COMPILERCHECK: content
      CCACHE_SLOPPINESS: time_macros
      OS: linux
      TARGET: fresh
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0
          fetch-tags: true

      - name: Build
        run: ./.ci/linux/build.sh v3 8

      - name: Package AppImage
        run: ./.ci/linux/package.sh v3 &> /dev/null

      - name: Upload Linux artifacts
        uses: forgejo/upload-artifact@v4
        with:
          name: linux.zip
          path: ./*.AppImage*

  android:
    runs-on: android

    env:
      CCACHE_DIR: /home/runner/.cache/ccache
      CCACHE_COMPILERCHECK: content
      CCACHE_SLOPPINESS: time_macros
      OS: android
      TARGET: universal

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0
          fetch-tags: true

      - name: Set tag name
        run: |
          if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
              echo "GIT_TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV
          fi
          echo $GIT_TAG_NAME

      - name: Build
        run: ANDROID_HOME=/opt/android-sdk ./.ci/android/build.sh

      - name: Package Android artifacts
        run: ./.ci/android/package.sh

      - name: Upload Android artifacts
        uses: forgejo/upload-artifact@v4
        with:
          name: android.zip
          path: artifacts/*

  create_release:
    needs: [linux, windows, android]
    runs-on: linux
    outputs:
      upload_url: ${{ steps.create_release.outputs.upload_url }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          submodules: 'recursive'
          path: 'eden-source'

      - name: Download artifacts
        uses: forgejo/download-artifact@v4
        with:
          path: artifacts

      - name: Grab and store version
        run: |
          cd eden-source
          tag_name=$(git describe --tags --abbrev=0)
          echo "VERSION=$tag_name" >> $GITHUB_ENV
          echo $tag_name

      - name: Package artifacts properly
        shell: bash
        run: |
          set -ex
          mv ${{ github.workspace }}/eden-source eden-${{ env.VERSION }}
          cd artifacts
          ls *.zip

          mkdir -p dist

          cp linux.zip/Eden-*.AppImage dist/Eden-Linux-${{ env.VERSION }}-amd64.AppImage
          cp linux.zip/Eden-*.AppImage.zsync dist/Eden-Linux-${{ env.VERSION }}-amd64.AppImage.zsync
          cp msvc.zip/eden-windows-msvc*.zip dist/Eden-Windows-MSVC-${{ env.VERSION }}-amd64.zip
          cp android.zip/eden-android*.apk dist/Eden-Android-${{ env.VERSION }}.apk
          cp android.zip/eden-android*.aab dist/Eden-Android-${{ env.VERSION }}.aab
          cp source.zip/eden-unified-source*.tar.xz dist/Eden-Source-${{ env.VERSION }}.tar.xz
          cp source.zip/eden-unified-source*.tar.xz.sha256sum dist/Eden-Source-${{ env.VERSION }}.tar.xz.sha256sum

      - name: Create release
        id: create_release
        uses: actions/forgejo-release@v2.6.0
        with:
          direction: upload
          tag: ${{ env.VERSION }}
          title: Eden ${{ env.VERSION }}
          release-dir: artifacts/dist/