-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add automated release workflow (#177)
* Add release workflow * Add version checking script * Lmao * Revert * Test * Test * Woops * Bumps Version to v3.2.1 * Add prettier * Prettified Code! * ??? * Prettified Code! * Bumps Version to v3.3.0 * Add the real release * Delete zip * Bumps Version to v5.0.0 * Woops * woooow * Bumps Version to v6.0.0 * dam * Bumps Version to v7.0.0 * Convert to pr * Correct pr creation * Bumps Version to v8.0.0 * ?? * Bumps Version to v9.0.0 * Bumps Version to v10.0.0 (#4) Co-authored-by: GitHub Action <[email protected]> * Revert * Bumps Version to v12.0.0 * Add token * Bumps Version to v14.0.0 * Change access token name * Set prettier options * Bumps Version to v15.0.0 * Wtf * Bumps Version to v16.0.0 * ? * Bumps Version to v17.0.0 * Test * Bumps Version to v18.0.0 * Wtf * Bumps Version to v19.0.0 * Final * Add suggestions * Remove relative path * Bumps Version to v20.0.0 * Revert "Bumps Version to v20.0.0" This reverts commit d65c5bd. * Try new prettier options * Bumps Version to v21.0.0 * Revert "Bumps Version to v21.0.0" This reverts commit 88ba221. * Revert changes * Bumps Version to v22.0.0 * ??? * Bumps Version to v23.0.0 * lol * Bumps Version to v24.0.0 * Lol * Bumps Version to v25.0.0 * Hm * Bumps Version to v26.0.0 * Wow * Only format changed files * Hardcode version * Bumps Version to v30.0.0 * Bumps Version to v32.0.0 * Undo version update --------- Co-authored-by: ayoung19 <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8fadf4e
commit 1b135e0
Showing
6 changed files
with
132 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Extension Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Build and compress | ||
run: | | ||
npm install | ||
npm run build | ||
zip -r extension-chrome.zip dist | ||
rm -rf dist | ||
npm run build_ff | ||
zip -r extension-firefox.zip dist | ||
- uses: "marvinpinto/[email protected]" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: false | ||
files: | | ||
extension-chrome.zip | ||
extension-firefox.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Extension Upgrade | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: Version | ||
required: true | ||
|
||
jobs: | ||
upgrade: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- name: Checkout Branch | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Update manifest/package.json version | ||
run: | | ||
./scripts/version-check.sh | ||
jq '.version = $ENV.VERSION' manifest.json > tmp && mv tmp manifest.json | ||
jq '.version = $ENV.VERSION' package.json > tmp && mv tmp package.json | ||
jq '.version = $ENV.VERSION | .packages."".version = $ENV.VERSION' package-lock.json > tmp && mv tmp package-lock.json | ||
npm install | ||
npx prettier --write manifest.json package.json package-lock.json | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
|
||
- name: Add and commit | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "Bumps Version to v${{ inputs.version }}" | ||
tag: "v${{ inputs.version }}" | ||
|
||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
branch: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,3 @@ node_modules/ | |
dist/ | ||
webpack.config.js | ||
.idea/ | ||
package.json | ||
package-lock.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CURRENT_VERSION=$(jq '.version' manifest.json | tr -d '"') | ||
NEW_VERSION="$VERSION" | ||
|
||
if ! echo "$CURRENT_VERSION" | grep -Eq '^[0-9]+.[0-9]+.[0-9]+$'; then | ||
echo Error: Current version not in valid format | ||
exit 1 | ||
fi | ||
|
||
if ! echo "$NEW_VERSION" | grep -Eq '^[0-9]+.[0-9]+.[0-9]+$'; then | ||
echo Error: New version not in valid format | ||
exit 1 | ||
fi | ||
|
||
IFS='.' read -ra CURR <<< "$CURRENT_VERSION" | ||
IFS='.' read -ra NEW <<< "$NEW_VERSION" | ||
|
||
for i in ${!NEW[*]}; do | ||
if [ $((NEW[i])) -lt $((CURR[i])) ]; then | ||
echo ERROR: New release version is less than current release version | ||
exit 1 | ||
elif [ $((NEW[i])) -gt $((CURR[i])) ]; then | ||
exit 0 | ||
fi | ||
done | ||
|
||
echo Error: Current and new version are equal | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters