Skip to content

feat: Auto-build the zip file on version change in manifest #19

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

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
86 changes: 86 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release Workflow

on:
push:
# branches:
# - main
# paths:
# - 'manifest.json'

jobs:
check_version:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version_check.outputs.new_version }}
old_version: ${{ steps.version_check.outputs.old_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Extract version from manifest
id: version_check
run: |
OLD_VERSION=$(git show HEAD~1:manifest.json | jq -r '.version' manifest.json)
NEW_VERSION=$(jq -r '.version' manifest.json)
echo ::set-output name=old_version::$OLD_VERSION
echo ::set-output name=new_version::$NEW_VERSION
echo "Old Version: $OLD_VERSION"
echo "New Version: $NEW_VERSION"

update_docs:
runs-on: ubuntu-latest
needs: check_version
if: ${{ needs.check_version.outputs.new_version != '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Update README with new version
run: |
NEW_VERSION=${{ needs.check_version.outputs.new_version }}
OLD_VERSION=${{ needs.check_version.outputs.old_version }}
sed -i "s/version:.*/version: $NEW_VERSION/" README.md
git commit -am "Update README for version $NEW_VERSION"
git push origin main

- name: Update CHANGELOG with latest changes
run: |
NEW_VERSION=${{ needs.check_version.outputs.new_version }}
echo "## $NEW_VERSION - $(date +'%Y-%m-%d')" >> CHANGELOG.md
echo "" >> CHANGELOG.md
echo "### Changes" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"- %s" >> CHANGELOG.md
git commit -am "Update CHANGELOG for version $NEW_VERSION"
git push origin main

build_and_release:
runs-on: ubuntu-latest
needs: [check_version, update_docs]
if: ${{ needs.check_version.outputs.new_version != '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build release for Chrome
run: |
mkdir -p release
zip -r release/signature-sync-chrome-${{ needs.check_version.outputs.new_version }}.zip . -x '.*' -x '__MACOSX' -x '*.md'

- name: Build release for Firefox
run: |
git checkout firefox
mkdir -p release
zip -r release/signature-sync-firefox-${{ needs.check_version.outputs.new_version }}.zip . -x '.*' -x '__MACOSX' -x '*.md'

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.check_version.outputs.new_version }}
name: v${{ needs.check_version.outputs.new_version }}
body: |
## Changes in this release
${{ steps.update_docs.outputs.changelog }}
## Old Version: ${{ needs.check_version.outputs.old_version }}
## New Version: ${{ needs.check_version.outputs.new_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "SignatureSync: Pro Signatures",
"short_name": "SignatureSync",
"description": "Simplify your messaging with SignatureSync, the tool that automates your signatures, ensuring a professional touch every time.",
"version": "3.3",
"version": "3.4",
"icons": {
"16": "icons/light/icon16.png",
"32": "icons/light/icon32.png",
Expand Down
Loading