Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
add9f7f
Add new release workflow with version bumping and automated checks
4Source Sep 11, 2025
5eedc6f
For testing purposes rename back to old name
4Source Sep 11, 2025
1921ddf
Change deprecated set-output
4Source Sep 11, 2025
82133c8
Fix checkout step to ensure correct ref is used
4Source Sep 11, 2025
5865ad9
add git status for bug fixing
4Source Sep 11, 2025
119c058
Add fetch-tags option to checkout step in manual release workflow
4Source Sep 11, 2025
8f9a884
Set fetch depth for checkout
4Source Sep 11, 2025
b665787
Test changes for release workflow
4Source Sep 11, 2025
1ae1f28
Add to workflow_dispatch automatic version selection
4Source Sep 11, 2025
37f0585
Improved logging
4Source Sep 11, 2025
5bb8e00
Use error logging
4Source Sep 11, 2025
315c29a
exit 1 on error
4Source Sep 11, 2025
988f2ba
Fix comparison of auto
4Source Sep 11, 2025
f7003dd
Edit manual release
4Source Sep 13, 2025
49af109
Fetch tags
4Source Sep 13, 2025
5cc4032
Update Continuous Deployment to Continuous Delivery
4Source Sep 13, 2025
34a1f54
Test changes in /src (#36)
4Source Sep 13, 2025
a610ef8
Continuous Integration only on push
4Source Sep 13, 2025
346e587
Remove If
4Source Sep 13, 2025
583d002
Test changes to /src (#37)
4Source Sep 13, 2025
d537d54
Bring back pull request for Continuos Integration
4Source Sep 13, 2025
66a6319
Continuous Integration change triggers
4Source Sep 13, 2025
415dfe1
Debug message
4Source Sep 13, 2025
523e0a8
Test changes to /src (#38)
4Source Sep 13, 2025
b1d675b
Change readout labels method for Continuous Delivery
4Source Sep 13, 2025
bb71039
Add permission contents write to Continuous Delivery
4Source Sep 13, 2025
97901c3
Test changes to /src (#41)
4Source Sep 13, 2025
a2e5575
Try reduced permissions on Continuous Integration
4Source Sep 13, 2025
f3b7824
Implement remove release type tags
4Source Sep 13, 2025
b033260
Test changes to /src (#42)
4Source Sep 13, 2025
72e09de
Apply version 1.0.0
4Source Sep 13, 2025
da30726
Improve release
4Source Sep 13, 2025
a89f23b
Test changes to /src (#43)
4Source Sep 13, 2025
6b4a2e4
Apply version 1.0.1
4Source Sep 13, 2025
d30764f
Use Env Var to pass files to release
4Source Sep 13, 2025
16bf95f
Merge branch 'feat-change-release-behavior' of https://github.com/4So…
4Source Sep 13, 2025
16da8ff
Apply version 1.0.1
4Source Sep 13, 2025
40e90e0
Fix checking for local tag
4Source Sep 13, 2025
2fe4020
Fix Skipping if no changes
4Source Sep 13, 2025
ef05739
Allow forced release
4Source Sep 13, 2025
8f8b442
Force not allowed with type auto
4Source Sep 13, 2025
feb0ee3
exit 1 on force release with auto
4Source Sep 13, 2025
0e45d91
exit 1 on manual release with no changes
4Source Sep 13, 2025
77294a5
remove exit 0
4Source Sep 13, 2025
a266e52
Apply version 1.1.0
4Source Sep 13, 2025
d38cb95
reactivated on master Continuous Delivery
4Source Sep 13, 2025
18a9d1b
Start of beta releases
4Source Sep 13, 2025
cf9d9bf
Fix force release in case of schedule
4Source Sep 17, 2025
87e808a
Change cron for testing
4Source Sep 17, 2025
f4139f3
Revert "Change cron for testing"
4Source Sep 17, 2025
149300b
Update eslint.config.mjs
4Source Nov 6, 2025
c86efb8
Update git configuration to GitHub Actions bot
4Source Mar 3, 2026
1c4f9de
Fix format + typos
4Source Mar 10, 2026
7f539ee
Add Sample command and integrate command registration
4Source Mar 13, 2026
8eb16f4
Fix missing package-lock update of version-change.mjs
4Source Mar 13, 2026
b659244
Fix condition for removing release type tags in release workflow
4Source Mar 13, 2026
70f5831
Disable automatic schedule
4Source Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Fixes # <!-- Issue number --->
- [<!-- x --> ] I have performed a self-review of my code
- [<!-- x --> ] I have commented my code, particularly in hard-to-understand areas
- [<!-- x --> ] I have made corresponding changes to the documentation
- [<!-- x --> ] I have tested my changes in Obsidian and describte how I tested in [Tests](#tests)
- [<!-- x --> ] I have tested my changes in Obsidian and describe how I tested in [Tests](#tests)
- [<!-- x --> ] My code fixes the feature discussed in [Related Issues](#related-issues) if not or not fully describe what is missing in [Missing changes](#missing-changes)
74 changes: 25 additions & 49 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,50 @@
name: Continuous Deployment
name: Continuous Delivery

on:
pull_request:
types:
- closed
branches:
- master
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
permissions:
pull-requests: write
contents: write

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install Dependencies
run: npm install
- name: Process Pull Request
id: process-pr
run: |
LABELS=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
echo "::debug::Labels: $LABELS"

- name: Bump version
id: version-bump
uses: 4Source/version-control-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
repository: ${{ github.event.repository.name }}
pr_number: ${{ github.event.number }}
tag_prefix: ''
dry_run: true
if echo "$LABELS" | grep -q 'major'; then
RELEASE_TYPE_TAG="major"
elif echo "$LABELS" | grep -q 'minor'; then
RELEASE_TYPE_TAG="minor"
elif echo "$LABELS" | grep -q 'patch'; then
RELEASE_TYPE_TAG="patch"
else
echo "::error::No tag found matching a release type."
exit 1
fi

- name: Configure git
run: |
git config --global user.name "4Source"
git config --global user.email "38220764+4Source@users.noreply.github.com."
echo "Release tag: $RELEASE_TYPE_TAG"
echo "release_type=$RELEASE_TYPE_TAG" >> $GITHUB_OUTPUT

- name: Change version in files
run: |
npm run version -- --new_version=${{ steps.version-bump.outputs.new_version }}

- name: Commit and push changes
- name: Configure git
run: |
git commit -a -m "Apply version ${{ steps.version-bump.outputs.new_version }}"
git push -f
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Push version tag
- name: Create or Update release type tag
run: |
git tag -a ${{ steps.version-bump.outputs.new_version }} -m "${{ steps.version-bump.outputs.new_version }}"
git push -f origin ${{ steps.version-bump.outputs.new_version }}

- name: Build plugin
run: npm run build

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FILES="main.js manifest.json"
if [ -f styles.css ]; then
FILES="$FILES styles.css"
fi
gh release create "${{ steps.version-bump.outputs.new_version }}" \
--title "${{ steps.version-bump.outputs.new_version }}" \
--draft $FILES
git tag -fa ${{ steps.process-pr.outputs.release_type }} -m "${{ steps.process-pr.outputs.release_type }}"
git push origin -f ${{ steps.process-pr.outputs.release_type }}
178 changes: 170 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ name: Continuous Integration

on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
paths:
- 'src/**'
- 'test/**'
push:
branches:
- master
paths:
- 'src/**'
- 'test/**'
workflow_dispatch:
branches:
- master

jobs:
test:
Expand Down Expand Up @@ -100,8 +103,6 @@ jobs:
name: Version Bump
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
pull-requests: write

steps:
- name: Checkout
Expand All @@ -115,4 +116,165 @@ jobs:
repository: ${{ github.event.repository.name }}
pr_number: ${{ github.event.number }}
tag_prefix: ''
dry_run: true
dry_run: true

beta-release:
name: Beta releases for pull requests
runs-on: ubuntu-latest
needs:
- test
- build
- version
# TODO: Beta releases are currently disabled
if: github.event_name == 'pull_request' && false

permissions:
pull-requests: write
contents: write

steps:
- name: Checkout
id: checkout
# TODO: Have to use this commit because fetch-tags is not working in main till this is merged to main
uses: actions/checkout@0548471950d86b19eae6c063105707c831fb5c03
with:
ref: ${{ github.event.ref }}
fetch-tags: true

- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Check changes since last release
id: changes
run: |
echo "skip=false" >> $GITHUB_OUTPUT

echo "::debug::Tags: git tag --list"

# Find the latest semver tag
LAST_VERSION_TAG=$(git tag --list | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | grep -v '-' | sort -V | tail -n1 || echo "")

if [ -z "$LAST_VERSION_TAG" ]; then
echo "No previous tag found. Assuming first release."
else
echo "Last tag: $LAST_VERSION_TAG"
if git diff --quiet "$LAST_VERSION_TAG"..HEAD -- src/; then
echo "No changes in /src since last release."
echo "skip=true" >> $GITHUB_OUTPUT
exit 0
else
echo "::debug::Changes detected in /src since last release."
fi
fi

# Find the highest release type
if git tag --list | grep -q 'major'; then
RELEASE_TYPE_TAG="major"
elif git tag --list | grep -q 'minor'; then
RELEASE_TYPE_TAG="minor"
elif git tag --list | grep -q 'patch'; then
RELEASE_TYPE_TAG="patch"
else
echo "::error::No tag found matching a release type."
exit 1
fi

echo "Release tag: $RELEASE_TYPE_TAG"
echo "release_type=$RELEASE_TYPE_TAG" >> $GITHUB_OUTPUT


- name: Install Dependencies
if: ${{ steps.changes.outputs.skip == 'false' }}
run: npm install

- name: Bump version
if: ${{ steps.changes.outputs.skip == 'false' }}
id: version-bump
uses: 4Source/version-control-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ github.repository_owner }}
repository: ${{ github.event.repository.name }}
version_increase: ${{ steps.changes.outputs.release_type }}
tag_prefix: ''
dry_run: true
# TODO: Is beta + beta string

- name: Configure git
if: ${{ steps.changes.outputs.skip == 'false' }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"

- name: Change version in files
if: ${{ steps.changes.outputs.skip == 'false' }}
run: |
npm run version -- --new_version=${{ steps.version-bump.outputs.new_version }}
git add manifest.json versions.json package.json

- name: Commit and push changes
if: ${{ steps.changes.outputs.skip == 'false' }}
run: |
git commit -a -m "Apply version ${{ steps.version-bump.outputs.new_version }}"
git push

- name: Push version tag
if: ${{ steps.changes.outputs.skip == 'false' }}
run: |
git tag -a ${{ steps.version-bump.outputs.new_version }} -m "${{ steps.version-bump.outputs.new_version }}"
git push origin ${{ steps.version-bump.outputs.new_version }}

- name: Build plugin
if: ${{ steps.changes.outputs.skip == 'false' }}
id: build-plugin
run: |
npm run build

if [ ! -f main.js ]; then
echo "Error: main.js is missing."
exit 1
fi

if [ ! -f manifest.json ]; then
echo "Error: manifest.json is missing."
exit 1
fi

FILES="main.js manifest.json"
if [ -f styles.css ]; then
FILES="$FILES styles.css"
fi
echo "release_files=$FILES" >> $GITHUB_OUTPUT

- name: Create release
if: ${{ steps.changes.outputs.skip == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FILES="${{ steps.build-plugin.outputs.release_files }}"
gh release create "${{ steps.version-bump.outputs.new_version }}" \
--title "${{ steps.version-bump.outputs.new_version }}" \
--generate-notes \
$FILES

- name: Remove release type tags
run: |
FAILED=0

for tag in major minor patch; do
if [ -n "$(git tag -l "$tag")" ]; then
echo "Deleting remote tag: $tag"
if git push --delete origin $tag; then
echo "::debug::Deleted remote tag $tag"
else
echo "::error::Failed to delete remote tag $tag"
FAILED=1
fi
else
echo "::debug::No $tag tag found locally."
fi
done

exit $FAILED
80 changes: 0 additions & 80 deletions .github/workflows/manual_release.yml

This file was deleted.

Loading
Loading