chore: adjust github actions workflows to 2.0

This commit is contained in:
Mikhail Zolotukhin 2021-11-02 23:12:34 +03:00
parent 9be8ea40a6
commit 50bcca3260
10 changed files with 106 additions and 28 deletions

14
.github/scripts/sysdep-install.sh vendored Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <mail@genda.life>
# SPDX-License-Identifier: MIT
set -e
apt-get update && apt-get install -y \
zip cmake ninja-build extra-cmake-modules kirigami2-dev \
libkf5config-dev libkf5configwidgets-dev libkf5coreaddons-dev \
libkf5declarative-dev libkf5i18n-dev libkf5kcmutils-dev \
libqt5svg5-dev qml-module-qtquick* qtbase5-dev \
qtdeclarative5-dev qtquickcontrols2-5-dev g++

8
.github/scripts/utils-install.sh vendored Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <mail@genda.life>
# SPDX-License-Identifier: MIT
set -e
apt-get update && apt-get install -y npm

View File

@ -16,10 +16,13 @@ jobs:
uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
- name: Install Commit Linting Tool 🔧
run: npm install --save-dev @commitlint/{cli,config-conventional}
- name: Set Linting Config to Conventional Commits spec 🔧
run: |
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
- name: Lint 🚨
run: npx commitlint --from HEAD~1 --to HEAD --verbose

View File

@ -12,10 +12,16 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container: ubuntu:21.10
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
- name: Setup CI Utils ⚙️
run: .github/scripts/utils-install.sh
- name: Install and Build 🔧
run: |
npm install

View File

@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- name: Checkout Code 🛎️
uses: actions/checkout@v2
- name: REUSE Compliance Check
- name: REUSE Compliance Check 🏛️
uses: fsfe/reuse-action@v1
lint:
@ -27,22 +27,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- name: Checkout Code 🛎️
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Validate QML and JavaScript files
- name: Validate QML and JavaScript files 💚
uses: liri-infra/qmllint-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dev Dependencies for Linters
- name: Install Dev Dependencies for Linters ⚙️
run: |
npm install
- name: Lint via Super Linter
- name: Lint via Super Linter 🚨
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
@ -57,24 +57,37 @@ jobs:
build:
name: Build
container: ubuntu:21.10
env:
DEBIAN_FRONTEND: noninteractive
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- name: Checkout Code 🛎️
uses: actions/checkout@v2
- name: Setup CI Utils ⚙️
run: .github/scripts/utils-install.sh
- name: Build 🔧
run: |
npm install
.github/scripts/sysdep-install.sh
npm run build
test:
name: Unit Tests
container: ubuntu:21.10
env:
DEBIAN_FRONTEND: noninteractive
runs-on: ubuntu-latest
steps:
- name: Checkout Code
- name: Checkout Code 🛎️
uses: actions/checkout@v2
- name: Setup CI Utils ⚙️
run: .github/scripts/utils-install.sh
- name: Test 🧪
run: |
npm install

View File

@ -20,21 +20,3 @@ jobs:
with:
release-type: node
package-name: release-please-action
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- name: Package 📦
run: |
npm install
npm run package
if: ${{ steps.release.outputs.release_created }}
- name: Publish 🎉
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release.outputs.tag_name }}
files: |
build/package/bismuth.tar.gz
build/package/bismuth.kwinscript
if: ${{ steps.release.outputs.release_created }}

View File

@ -23,6 +23,7 @@ To prepare environment, clone the project and execute the following:
```sh
npm install # Install development dependencies
npm run sysdep-install # Install system dependencies
```
This will install all the things you need, including TypeScript compiler, Unit

View File

@ -42,6 +42,7 @@ script.
Install script from source:
npm install # Installs dependencies for building
npm run sysdep-install # Install system dependencies for building
npm run bi-install # Installs all Bismuth components
To uninstall:

View File

@ -28,6 +28,7 @@
"scripts": {
"clean": "scripts/clean.sh",
"build": "scripts/build.sh",
"sysdep-install": "scripts/sysdep-install.sh",
"prebi-install": "npm run build",
"bi-install": "scripts/install.sh",
"bi-uninstall": "scripts/uninstall.sh",
@ -36,8 +37,7 @@
"postinstall-and-restart-kwin-x11": "bash -ic \"kwin_x11 --replace & disown\"",
"docs": "npx typedoc --out $npm_package_config_build_dir/docs",
"test": "jest",
"prepare": "husky install",
"postinstall": "scripts/dep-install.sh"
"prepare": "husky install"
},
"repository": {
"type": "git",

50
scripts/sysdep-install.sh Normal file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env sh
# SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <mail@genda.life>
# SPDX-License-Identifier: MIT
set -e
echo "⛓️ Installing system dependencies..."
if [ -f /etc/os-release ]; then
. /etc/os-release
case $ID in
"ubuntu" | "pop" | "debian")
sudo apt-get install -y \
zip cmake ninja-build extra-cmake-modules kirigami2-dev \
libkf5config-dev libkf5configwidgets-dev libkf5coreaddons-dev \
libkf5declarative-dev libkf5i18n-dev libkf5kcmutils-dev \
libqt5svg5-dev qml-module-qtquick* qtbase5-dev \
qtdeclarative5-dev qtquickcontrols2-5-dev g++
;;
"fedora")
sudo dnf install -y \
kf5-kconfigwidgets-devel qt5-qtbase-devel qt5-qtbase-private-devel \
qt5-qtdeclarative-devel qt5-qtquickcontrols2-devel qt5-qtsvg-devel \
qt5-qtfeedback-devel cmake ninja-build extra-cmake-modules \
kf5-kcmutils-devel kf5-ki18n-devel kf5-kdeclarative-devel
;;
"opensuse-tumbleweed" | "opensuse-leap")
sudo zypper --non-interactive install --recommends -t pattern devel_qt5 devel_C_C++
sudo zypper --non-interactive in -y \
ninja extra-cmake-modules kconfig-devel kcmutils-devel kdeclarative-devel \
ki18n-devel
;;
"arch")
sudo pacman -S --noconfirm --needed \
cmake ninja extra-cmake-modules
;;
*)
echo "⚠ Your distribution is $PRETTY_NAME, but you have to install system dependencies manually."
;;
esac
else
echo "⚠ Cannot detect your distribution. You have to install system dependencies manually."
fi