Skip to content

Nightly

Nightly #1294

Workflow file for this run

# Copyright (C) 2019-2021 Julian Valentin, LTeX Development Community
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
name: "Nightly"
on:
schedule:
- cron: "30 3 * * *"
workflow_dispatch:
jobs:
deploy:
name: "Nightly - Deploy Job"
runs-on: "ubuntu-20.04"
steps:
- name: "Checkout Repository"
uses: "actions/checkout@v2"
- name: "Set up Node.js"
uses: "actions/setup-node@v1"
with:
node-version: "16.11.0"
- name: "Install Node.js Dependencies"
run: "npm install && npm install -g vsce@1 [email protected]"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9.0"
- name: "Install Python Dependencies"
run: "python -u -m pip install --upgrade pip && pip install semver==2.13.0"
- name: "Set VSCODE_LTEX_VERSION"
run: "echo \"VSCODE_LTEX_VERSION=$(python -u -c \"import datetime; import json; version = json.load(open('package.json', 'r'))['version']; print('{}.nightly.{}'.format((version[:-8] if version.endswith('.develop') else version), datetime.datetime.today().strftime('%Y-%m-%d')), end='')\")\" >> $GITHUB_ENV"
- name: "Check VSCODE_LTEX_VERSION"
run: "if [[ -z \"$VSCODE_LTEX_VERSION\" ]]; then echo 'Error: VSCODE_LTEX_VERSION not set!'; (exit 1); fi; echo \"VSCODE_LTEX_VERSION set to '$VSCODE_LTEX_VERSION'\""
- name: "Bump Version"
run: "python -u -c \"import json; file = open('package.json', 'r+'); json_ = json.loads(file.read()); json_['version'] = '${{ env.VSCODE_LTEX_VERSION }}'; file.seek(0); file.truncate(); file.write(json.dumps(json_, indent=2) + '\\n')\""
- name: "Update Version of LTeX LS"
env:
LTEX_GITHUB_OAUTH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: "python -u tools/updateLtexLsVersionAndHashDigests.py --tag nightly"
- name: "Build Package with vsce"
run: "vsce package"
- name: "Build Offline Packages"
env:
LTEX_GITHUB_OAUTH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: "python -u tools/createOfflinePackages.py"
- name: "Delete Old Nightly Releases"
uses: "dev-drprasad/[email protected]"
with:
keep_latest: 0
delete_tag_pattern: "nightly"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Update Nightly Tag"
run: "git tag -f nightly && git push -f origin nightly"
- name: "Create GitHub Release"
uses: "softprops/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
tag_name: "nightly"
name: "${{ env.VSCODE_LTEX_VERSION }}"
prerelease: true
body: "This is a nightly build. Use at your own risk."
files: "vscode-ltex-${{ env.VSCODE_LTEX_VERSION }}-offline-linux-x64.vsix\nvscode-ltex-${{ env.VSCODE_LTEX_VERSION }}-offline-mac-x64.vsix\nvscode-ltex-${{ env.VSCODE_LTEX_VERSION }}-offline-windows-x64.vsix"