diff options
author | Micah Lee <micah@micahflee.com> | 2022-10-06 09:14:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 09:14:05 -0700 |
commit | 702aac87e93df3784a6d98aca1cce3580e6bde67 (patch) | |
tree | d43f5df00076aa81a1a5c92ff7bab1cc3904447e /.github | |
parent | 3f73c31966bfef0ab439396032ba0418e4f16a9a (diff) | |
download | onionshare-702aac87e93df3784a6d98aca1cce3580e6bde67.tar.gz onionshare-702aac87e93df3784a6d98aca1cce3580e6bde67.zip |
Snapcraft and Flatpak in CI (#1620)
Add support for Snapcraft and Flatpak builds in GitHub Actions
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 64 |
1 files changed, 58 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 440bd305..c945468d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: Build -run-name: Build win32, win64, mac (Intel) 🚀 +run-name: Build win32, win64, mac (Intel), snap (amd64) 🚀 on: push: branches: @@ -34,7 +34,7 @@ jobs: with: path: desktop\build\tor key: ${{ runner.os }}-win64-tor-${{ hashFiles('desktop/scripts/get-tor.py') }} - + - name: Get tor binaries from Tor Browser (64-bit) run: cd desktop && C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts\poetry run python .\scripts\get-tor.py win64 @@ -128,7 +128,7 @@ jobs: with: path: desktop\build\tor key: ${{ runner.os }}-win32-tor-${{ hashFiles('desktop/scripts/get-tor.py') }} - + - name: Get tor binaries from Tor Browser (32-bit) run: cd desktop && C:\hostedtoolcache\windows\Python\3.9.13\x86\Scripts\poetry run python .\scripts\get-tor.py win32 @@ -211,7 +211,7 @@ jobs: runs-on: macos-latest steps: - uses: actions/checkout@v3 - + - name: Install Python 3.9.13 (Intel) run: | curl -L https://www.python.org/ftp/python/3.9.13/python-3.9.13-macosx10.9.pkg --output ~/Downloads/python.pkg @@ -237,7 +237,7 @@ jobs: with: path: desktop/build/tor key: ${{ runner.os }}-macos-tor-${{ hashFiles('desktop/scripts/get-tor.py') }} - + - name: Get tor binaries from Tor Browser run: | cd desktop @@ -303,4 +303,56 @@ jobs: - uses: actions/upload-artifact@v3 with: name: mac-build - path: ~/onionshare-macos.tar.gz
\ No newline at end of file + path: ~/onionshare-macos.tar.gz + + build-snap: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies + run: | + sudo lxd init --auto + sudo snap install snapcraft --classic + + - name: Build snap + run: sudo snapcraft --use-lxd + + - uses: actions/upload-artifact@v3 + with: + name: snapcraft-build + path: onionshare_*.snap + + build-flatpak: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + run: | + sudo apt update + sudo apt install -y flatpak flatpak-builder + flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo + + - name: Restore cache - .flatpak-builder + uses: actions/cache@v3 + with: + path: flatpak/.flatpak-builder + key: flatpak-.flatpak-builder + + - name: Restore cache - build + uses: actions/cache@v3 + with: + path: flatpak/build + key: flatpak-build + + - name: Flatpak build + run: | + cd flatpak + flatpak-builder build --force-clean --install-deps-from=flathub --install --user org.onionshare.OnionShare.yaml + flatpak build-bundle ~/.local/share/flatpak/repo ~/OnionShare.flatpak org.onionshare.OnionShare --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo + + - uses: actions/upload-artifact@v3 + with: + name: flatpak-build + path: ~/OnionShare.flatpak |