From be0bf2cfdc5871184d66f4a94b85a315617c820b Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 10:45:16 +0800 Subject: [PATCH 1/7] docs: update repository references from mczachurski to nodite Update all GitHub repository URLs and badge links to reflect the new repository owner (nodite instead of mczachurski). This includes: - Build status badge URL - Homebrew tap installation command - Git clone URLs in installation instructions Also remove trailing whitespace from several lines. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 211d759..900c0e4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 💻 wallpapper / wallpapper-exif -![Build Status](https://github.com/mczachurski/wallpapper/workflows/Build/badge.svg) +![Build Status](https://github.com/nodite/wallpapper/workflows/Build/badge.svg) [![Swift 5.2](https://img.shields.io/badge/Swift-5.2-orange.svg?style=flat)](ttps://developer.apple.com/swift/) [![Swift Package Manager](https://img.shields.io/badge/SPM-compatible-4BC51D.svg?style=flat)](https://swift.org/package-manager/) [![Platforms OS X | Linux](https://img.shields.io/badge/Platforms-macOS%20-lightgray.svg?style=flat)](https://developer.apple.com/swift/) @@ -32,7 +32,7 @@ You need to have latest XCode (10.2) and Swift 5 installed. Open your terminal and run following commands. ```bash -brew tap mczachurski/wallpapper +brew tap nodite/wallpapper brew install wallpapper ``` @@ -41,7 +41,7 @@ brew install wallpapper Open your terminal and run following commands. ```bash -$ git clone https://github.com/mczachurski/wallpapper.git +$ git clone https://github.com/nodite/wallpapper.git $ cd wallpapper $ swift build --configuration release $ sudo cp .build/release/wallpapper /usr/local/bin @@ -53,7 +53,7 @@ If you are using swift in version 4.1, please edit `Package.swift` file and put Also you can build using `build.sh` script (it uses `swiftc` instead Swift CLI). ```bash -$ git clone https://github.com/mczachurski/wallpapper.git +$ git clone https://github.com/nodite/wallpapper.git $ cd wallpapper $ ./build.sh $ sudo cp .output/wallpapper /usr/local/bin @@ -76,17 +76,17 @@ That's all. Now you can build your own dynamic wallpappers. ### Troubleshooting -If you get an error during the Swift build portion of install, try downloading the entire Xcode IDE (not just the tools) from the app store. Then run +If you get an error during the Swift build portion of install, try downloading the entire Xcode IDE (not just the tools) from the app store. Then run ```bash -sudo xcode-select -s /Applications/Xcode.app/Contents/Developer +sudo xcode-select -s /Applications/Xcode.app/Contents/Developer ``` and run the installation command again. ## Getting started -If you have done above commands now you can build dynamic wallpaper. It's really easy. First you have to put all you pictures into one folder and in the same folder create `json` file with picture's description. Application support three kinds of dynamic wallpapers. +If you have done above commands now you can build dynamic wallpaper. It's really easy. First you have to put all you pictures into one folder and in the same folder create `json` file with picture's description. Application support three kinds of dynamic wallpapers. ### Solar @@ -165,7 +165,7 @@ Properties: ### Apperance -For wallpapers based on OS apperance settings (light/dark) we have to prepare much simpler JSON file, and we have to use only two images (one for light and one for dark theme). +For wallpapers based on OS apperance settings (light/dark) we have to prepare much simpler JSON file, and we have to use only two images (one for light and one for dark theme). ```json [ @@ -196,7 +196,7 @@ When you have `json` file and all pictures then you can generate `heic` file. Yo wallpapper -i wallpapper.json ``` -You should got a new file: `output.heic`. Set this file as a new wallpaper and enjoy you own dynamic wallpaper! +You should got a new file: `output.heic`. Set this file as a new wallpaper and enjoy you own dynamic wallpaper! ### Extracting metadata From b9154f15575054a6f304bb6d43c9d5bcb64c7f70 Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 10:47:16 +0800 Subject: [PATCH 2/7] ci: upgrade actions/upload-artifact from v3 to v4 Update GitHub Actions workflow to use the latest version of upload-artifact action for improved performance and compatibility. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2c6012..37f1c49 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: - name: Build run: swift build --configuration release --arch arm64 --arch x86_64 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: wallpaper path: | From 89f64f7e3c1432c3a6e8a472423af38db942c3d2 Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 13:05:57 +0800 Subject: [PATCH 3/7] feat: add auto-tagging workflow for version management --- .github/workflows/auto-tag.yml | 94 ++++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 18 ++++++- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/auto-tag.yml diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml new file mode 100644 index 0000000..c8c751f --- /dev/null +++ b/.github/workflows/auto-tag.yml @@ -0,0 +1,94 @@ +name: Auto Tag + +on: + push: + branches: + - release + +jobs: + auto-tag: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get version from commit + id: get_version + run: | + # 从最近的提交消息或版本文件中获取版本号 + # 检查是否有版本号相关的提交 + VERSION=$(git log -1 --pretty=%B | grep -oP '(?<=version |v)\d+\.\d+\.\d+' || echo "") + + if [ -z "$VERSION" ]; then + # 如果提交消息中没有版本号,尝试从现有标签递增 + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "0.0.0") + echo "Latest tag: $LATEST_TAG" + + # 提取版本号并递增补丁版本 + if [[ $LATEST_TAG =~ ^v?([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then + MAJOR="${BASH_REMATCH[1]}" + MINOR="${BASH_REMATCH[2]}" + PATCH="${BASH_REMATCH[3]}" + PATCH=$((PATCH + 1)) + VERSION="$MAJOR.$MINOR.$PATCH" + else + VERSION="1.0.0" + fi + fi + + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "New version will be: $VERSION" + + - name: Check if tag exists + id: check_tag + run: | + VERSION="${{ steps.get_version.outputs.version }}" + if git rev-parse "$VERSION" >/dev/null 2>&1; then + echo "exists=true" >> $GITHUB_OUTPUT + echo "Tag $VERSION already exists" + else + echo "exists=false" >> $GITHUB_OUTPUT + echo "Tag $VERSION does not exist" + fi + + - name: Update version in source files + if: steps.check_tag.outputs.exists == 'false' + run: | + VERSION="${{ steps.get_version.outputs.version }}" + + # 更新 Wallpapper/Program.swift 中的版本 + sed -i '' "s/self.consoleIO.writeMessage(\"[0-9]\+\.[0-9]\+\.[0-9]\+\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/Wallpapper/Program.swift + + # 更新 WallpapperExif/Program.swift 中的版本 + sed -i '' "s/self.consoleIO.writeMessage(\"[0-9]\+\.[0-9]\+\.[0-9]\+\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/WallpapperExif/Program.swift + + echo "Updated version to $VERSION in source files" + + - name: Commit version changes + if: steps.check_tag.outputs.exists == 'false' + run: | + VERSION="${{ steps.get_version.outputs.version }}" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + # 检查是否有变更 + if git diff --quiet; then + echo "No version changes to commit" + else + git add Sources/Wallpapper/Program.swift Sources/WallpapperExif/Program.swift + git commit -m "chore: bump version to $VERSION" + git push origin release + echo "Committed and pushed version changes" + fi + + - name: Create and push tag + if: steps.check_tag.outputs.exists == 'false' + run: | + VERSION="${{ steps.get_version.outputs.version }}" + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "$VERSION" -m "Release $VERSION" + git push origin "$VERSION" + echo "Created and pushed tag: $VERSION" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37f1c49..ca441a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,13 +2,18 @@ name: Build on: push: + branches: + - release + tags: + - '*' jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 + - name: Build run: swift build --configuration release --arch arm64 --arch x86_64 @@ -18,3 +23,14 @@ jobs: path: | .build/apple/Products/Release/wallpapper .build/apple/Products/Release/wallpapper-exif + + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: | + .build/apple/Products/Release/wallpapper + .build/apple/Products/Release/wallpapper-exif + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 07df272aa11c5d84d02a662efaa65990f941aa84 Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 13:09:53 +0800 Subject: [PATCH 4/7] fix: correct sed command syntax for version update in source files --- .github/workflows/auto-tag.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index c8c751f..1727281 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -59,10 +59,10 @@ jobs: VERSION="${{ steps.get_version.outputs.version }}" # 更新 Wallpapper/Program.swift 中的版本 - sed -i '' "s/self.consoleIO.writeMessage(\"[0-9]\+\.[0-9]\+\.[0-9]\+\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/Wallpapper/Program.swift + sed -i "s/self\.consoleIO\.writeMessage(\"\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/Wallpapper/Program.swift # 更新 WallpapperExif/Program.swift 中的版本 - sed -i '' "s/self.consoleIO.writeMessage(\"[0-9]\+\.[0-9]\+\.[0-9]\+\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/WallpapperExif/Program.swift + sed -i "s/self\.consoleIO\.writeMessage(\"\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\)\")/self.consoleIO.writeMessage(\"$VERSION\")/" Sources/WallpapperExif/Program.swift echo "Updated version to $VERSION in source files" From f443d07d6a8534ec9fbe8f4c12e90d0552810110 Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 13:13:51 +0800 Subject: [PATCH 5/7] ci: remove branch trigger from build workflow --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca441a5..ad28e86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: Build on: push: - branches: - - release tags: - '*' From 1e6cc59a1cd122b06620bec6094003478bc3f4ff Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 13:24:25 +0800 Subject: [PATCH 6/7] fix: ensure GITHUB_TOKEN is set for actions in auto-tag workflow --- .github/workflows/auto-tag.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 1727281..7f83bb9 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -13,6 +13,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} - name: Get version from commit id: get_version @@ -68,6 +69,8 @@ jobs: - name: Commit version changes if: steps.check_tag.outputs.exists == 'false' + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} run: | VERSION="${{ steps.get_version.outputs.version }}" git config user.name "github-actions[bot]" @@ -85,6 +88,8 @@ jobs: - name: Create and push tag if: steps.check_tag.outputs.exists == 'false' + env: + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} run: | VERSION="${{ steps.get_version.outputs.version }}" git config user.name "github-actions[bot]" From c68f17161473011c06a1f85ec6ed4123d1c0f063 Mon Sep 17 00:00:00 2001 From: Oscaner Miao Date: Thu, 8 Jan 2026 13:33:51 +0800 Subject: [PATCH 7/7] fix: update auto-tag workflow to trigger on closed pull requests --- .github/workflows/auto-tag.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 7f83bb9..efa1c8f 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -1,17 +1,22 @@ name: Auto Tag on: - push: + pull_request: + types: + - closed branches: - release jobs: auto-tag: + # 只在 PR 被合并时运行 + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: + ref: release fetch-depth: 0 token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}