Skip to content

Commit

Permalink
Upgrade GitHub actions versions (hrai#271)
Browse files Browse the repository at this point in the history
* using new upload-artifact version

* cleanup

* cleanup

* using native web-ext for firefor submission

* removed web-ext-submit

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup
  • Loading branch information
hrai authored and Felix Wong committed Oct 15, 2024
1 parent dbdb768 commit f580b91
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 90 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
name: 'CodeQL'

on:
push:
Expand All @@ -29,43 +29,43 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
25 changes: 12 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ name: Node CI
on: [push, pull_request]
jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
version: ${{ steps.daily-version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 20
- run: yarn install
Expand All @@ -30,25 +30,24 @@ jobs:
name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
gh release create "${{ steps.daily-version.outputs.version }}"
run: gh release create "${{ steps.daily-version.outputs.version }}"

Build-and-upload-artifacts:
needs: Version
if: github.event_name == 'push' || needs.Version.outputs.created
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [18.x]
command:
- firefox
- chrome
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: yarn install --frozen-lockfile

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: yarn install, build, and test
Expand All @@ -60,8 +59,9 @@ jobs:
VER: ${{ needs.Version.outputs.version }}
run: |
yarn update-version:${{ matrix.command }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: auto-capitalise-artifacts-${{ strategy.job-index }}
path: distribution

Submit:
Expand All @@ -75,7 +75,7 @@ jobs:
- chrome
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: yarn install
- run: yarn build
- name: Update extension’s meta
Expand Down
74 changes: 43 additions & 31 deletions distribution/manifest_v2.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
{
"name": "Auto Capitalise Sentence",
"description": "Browser add-on/extension to automatically capitalise the first letter of a sentence while typing.",
"homepage_url": "https://github.com/hrai/auto-capitalise-sentence/",
"manifest_version": 2,
"version": "0.0.0",
"browser_action": {
"default_icon": "icons/auto-capitalise-sentence.png",
"default_title": "Auto-capitalise sentence",
"default_popup": "popup/settings.html"
},
"background": {
"scripts": ["dependencies/jquery.min.js", "lib/background.bundle.js"]
},
"content_scripts": [
{
"run_at": "document_end",
"matches": ["<all_urls>"],
"js": [
"dependencies/jquery.min.js",
"lib/main.bundle.js",
"lib/settings.bundle.js"
]
}
],
"icons": {
"16": "icons/auto-capitalise-sentence.png",
"48": "icons/auto-capitalise-sentence.png",
"128": "icons/auto-capitalise-sentence.png"
},
"permissions": ["storage", "tabs"]
"name": "Auto Capitalise Sentence",
"description": "Firefox browser add-on/extension to automatically capitalise the first letter of a sentence while typing.",
"homepage_url": "https://github.com/hrai/auto-capitalise-sentence/",
"manifest_version": 2,
"version": "0.0.0",
"browser_action": {
"default_icon": "icons/auto-capitalise-sentence.png",
"default_title": "Auto-capitalise sentence",
"default_popup": "popup/settings.html"
},
"background": {
"scripts": [
"dependencies/jquery.min.js",
"lib/background.bundle.js"
]
},
"content_scripts": [
{
"run_at": "document_end",
"matches": [
"<all_urls>"
],
"js": [
"dependencies/jquery.min.js",
"lib/main.bundle.js",
"lib/settings.bundle.js"
]
}
],
"icons": {
"16": "icons/auto-capitalise-sentence.png",
"48": "icons/auto-capitalise-sentence.png",
"128": "icons/auto-capitalise-sentence.png"
},
"permissions": [
"storage",
"tabs"
],
"browser_specific_settings": {
"gecko": {
"id": "{680e06ed-65ed-4e11-a9c0-0e6f80b9a347}"
}
}
}
4 changes: 2 additions & 2 deletions distribution/manifest_v3.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Auto Capitalise Sentence",
"description": "Browser add-on/extension to automatically capitalise the first letter of a sentence in text fields while typing.",
"description": "Chromium browser add-on/extension to automatically capitalise the first letter of a sentence in text fields while typing.",
"homepage_url": "https://github.com/hrai/auto-capitalise-sentence/",
"manifest_version": 3,
"version": "0.0.0",
Expand Down Expand Up @@ -35,4 +35,4 @@
"default_popup": "popup/settings.html"
},
"content_security_policy": {}
}
}
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint-fix": "yarn eslint --fix .",
"update-version:chrome": "yarn dot-json distribution/manifest_v3.json version $VER && cd distribution && mv manifest_v3.json manifest.json",
"update-version:firefox": "yarn dot-json distribution/manifest_v2.json version $VER && cd distribution && mv manifest_v2.json manifest.json",
"release:firefox": "cd distribution && yarn web-ext-submit",
"release:firefox": "cd distribution && yarn web-ext sign --channel listed",
"release:chrome": "cd distribution && npx chrome-webstore-upload-cli@2 upload --auto-publish",
"prepare": "yarn husky install"
},
Expand Down Expand Up @@ -55,7 +55,6 @@
"run-script-os": "^1.1.3",
"sinon": "^19.0.2",
"web-ext": "^8.2.0",
"web-ext-submit": "^7.8.0",
"webextension-polyfill": "^0.12.0",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
Expand Down

0 comments on commit f580b91

Please sign in to comment.