Skip to content

build: remove some obsolete config files #3

build: remove some obsolete config files

build: remove some obsolete config files #3

name: Build, Bump version numbers, and update changelog
on:
push:
branches: [main] # not on insider release branch
workflow_dispatch:
permissions:
contents: write
jobs:
bump:
runs-on: macos-latest
name: Build, Bump version numbers, and update changelog
steps:
- name: Checkout
uses: actions/checkout@v4
# by default, no tags and only a single commit is fetched. To use git
# history in the changelog step, we need to fetch all history.
with:
fetch-depth: 0 # 0 = all history
fetch-tags: true
#─────────────────────────────────────────────────────────────────────────
- name: Build
run: |
cat ./source/*.css <(echo "/* @settings") ./source/style-settings.yaml <(echo "*/") \
> ./theme.css
- name: Bump version numbers
run: |
theme_header="./source/00 header.css"
versionLine=$(grep --line-number --max-count=1 "^Version" "$theme_header")
versionLnum=$(echo "$versionLine" | cut -d: -f1)
currentVer=$(echo "$versionLine" | cut -d. -f2)
nextVer=$((currentVer + 1))
sed -E -i '' "${versionLnum} s/$currentVer/$nextVer/" "$theme_header"
sed -E -i '' "${versionLnum} s/$currentVer/$nextVer/" "./theme.css"
sed -E -i '' "/version/ s/$currentVer/$nextVer/" "./manifest.json"
- name: Update Download Count in Readme
run: |
dl=$(curl -s "https://releases.obsidian.md/stats/theme" |
grep -oe '"Shimmering Focus","download":[[:digit:]]*' |
cut -d: -f2)
sed -E -i '' "s/badge.*-[[:digit:]]+-/badge\/downloads-$dl-/" ./README.md
- name: Update Changelog
run: |
commits_since_last_publish=$(git log :/bump.. --format="- %cs %s")
echo "$commits_since_last_publish" |
grep -vE "build|ci|style|bump" | # don't include internal changes
sed -E "s/^(- [0-9-]+) ([^ ]+): /\1 **\2**: /" | # bold title
grep -v "^$" > "temp.md"
cat "Changelog.md" >> "temp.md"
mv -f "temp.md" "Changelog.md"
#─────────────────────────────────────────────────────────────────────────
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "bump: version & update changelog"
branch: ${{ github.head_ref }}