tdesktop/.github/workflows/snap.yml

89 lines
2.1 KiB
YAML
Raw Normal View History

2020-01-25 05:44:58 +00:00
name: Snap.
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/snap.yml'
- 'Telegram/build/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
2020-01-25 05:44:58 +00:00
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/snap.yml'
- 'Telegram/build/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
2020-01-25 05:44:58 +00:00
jobs:
linux:
name: Ubuntu
runs-on: ubuntu-latest
2020-01-25 05:44:58 +00:00
env:
UPLOAD_ARTIFACT: "false"
steps:
- name: Clone.
2020-03-20 16:32:06 +00:00
uses: actions/checkout@v2
2020-01-25 05:44:58 +00:00
with:
2020-12-24 02:07:07 +00:00
fetch-depth: 0
2020-01-25 05:44:58 +00:00
submodules: recursive
- name: First set up.
run: |
sudo apt-get purge --autoremove lxd
2020-01-25 05:44:58 +00:00
sudo snap install --classic snapcraft
sudo snap install lxd
2020-01-25 05:44:58 +00:00
# Workaround for snapcraft
2020-03-20 20:26:04 +00:00
# See https://forum.snapcraft.io/t/13258
2020-01-25 05:44:58 +00:00
sudo chown root:root /
sudo usermod -aG lxd $USER
sudo snap run lxd init --auto
sudo snap run lxd waitready
2020-01-25 05:44:58 +00:00
- name: Telegram Desktop snap build.
run: sg lxd -c 'snap run snapcraft --use-lxd'
2020-01-25 05:44:58 +00:00
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
run: |
artifact_name=$(echo telegram-desktop_*.snap)
2020-10-25 01:46:27 +00:00
echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV
2020-01-25 05:44:58 +00:00
mkdir artifact
mv $artifact_name artifact
- uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifact