Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add CI/CD workflows using github actions #373

Merged
merged 9 commits into from
Apr 2, 2024
Merged
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow builds the gnome extension for release on extensions.gnome.org

# For more information see:
#@ https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: release

on:
release:
types: [published]
workflow_dispatch:
inputs:
ref:
description: "Override git ref"
type: string
default: ""
required: false

jobs:
pypi:
strategy:
matrix:
node_version: ["latest"]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Install linux tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext make zip curl

- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: Install Node.js project dependencies
run: npm ci --verbose

# - name: Build Node.js project
# run: npm run build --if-present --verbose

# - name: Test Node.js project
# run: npm test --verbose

- name: Test Packaging
run: make dist

- name: Archive release artifacts
uses: actions/upload-artifact@v4
with:
name: forge-gnome-extension
path: [email protected]
# path: temp/

- name: Upload extension to Goe
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -F "source=@[email protected]" -F "tos_compliant=on" -F "shell_license_compliant=on" https://extensions.gnome.org/upload/
65 changes: 65 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will install Node/NPM dependencies, run tests and lint source code

# For more information see:
#@ https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: testing

on:
push:
branches: ["main"]
paths-ignore:
- .git*
- .husky/**
- "*.md"
pull_request:
branches: ["main"]
types: [opened, reopened, synchronize, ready_for_review]
paths-ignore:
- .git*
- .husky/**
- "*.md"
workflow_dispatch:
inputs:
ref:
description: 'Override git ref'
type: string
default: ''
required: false

jobs:
linting:
strategy:
fail-fast: true
matrix:
os: ["ubuntu-22.04", "ubuntu-latest"]
node_version: ["18.x", "20.x", "latest"]

runs-on: "${{ matrix.os }}"
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Install linux tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext make zip

- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: Install Node.js project dependencies
run: npm ci --verbose

- name: Build Node.js project
run: npm run build --if-present --verbose

- name: Test Node.js project
run: npm test --verbose

- name: Test Packaging
run: make dist
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ gschemas.compiled
po
.vscode
node_modules
.github
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@ test-shell-open:

format:
npm run format

# npx prettier --list-different "./**/*.{js,jsx,ts,tsx,json}"
lint:
npm test
18 changes: 15 additions & 3 deletions config/windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@
{ "wmClass": "zoom", "mode": "float" },
{ "wmClass": "firefox", "wmTitle": "About Mozilla Firefox", "mode": "float" },
{ "wmClass": "firefox", "wmTitle": "!Mozilla Firefox", "mode": "float" },
{ "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "About Mozilla Firefox", "mode": "float" },
{
"wmClass": "org.mozilla.firefox.desktop",
"wmTitle": "About Mozilla Firefox",
"mode": "float"
},
{ "wmClass": "org.mozilla.firefox.desktop", "wmTitle": "!Mozilla Firefox", "mode": "float" },
{ "wmClass": "thunderbird", "wmTitle": "About Mozilla Thunderbird", "mode": "float" },
{ "wmClass": "thunderbird", "wmTitle": "!Mozilla Thunderbird", "mode": "float" },
{ "wmClass": "org.mozilla.Thunderbird.desktop", "wmTitle": "About Mozilla Thunderbird", "mode": "float" },
{ "wmClass": "org.mozilla.Thunderbird.desktop", "wmTitle": "!Mozilla Thunderbird", "mode": "float" }
{
"wmClass": "org.mozilla.Thunderbird.desktop",
"wmTitle": "About Mozilla Thunderbird",
"mode": "float"
},
{
"wmClass": "org.mozilla.Thunderbird.desktop",
"wmTitle": "!Mozilla Thunderbird",
"mode": "float"
}
]
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"gettext-domain": "forge",
"uuid": "[email protected]",
"settings-schema": "org.gnome.shell.extensions.forge",
"shell-version": ["45","46"],
"shell-version": ["45", "46"],
"session-modes": ["user", "unlock-dialog"],
"version": "1.2-alpha",
"url": "https://github.com/forge-ext/forge"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Forge - Tiling Extension for GNOME",
"main": "extension.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "prettier --list-different \"./**/*.{js,jsx,ts,tsx,json}\"",
"prepare": "husky install",
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,json}\""
},
Expand Down