Skip to content

Commit

Permalink
馃敤 brat release updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jan 8, 2022
1 parent 005f81d commit 3e23b49
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Expand Up @@ -18,3 +18,7 @@ insert_final_newline = true

[*.md]
trim_trailing_whitespace = false


[*.yml]
indent_size = 2
39 changes: 39 additions & 0 deletions .github/changelog.hbs
@@ -0,0 +1,39 @@
### Changelog

{{#each releases}}
{{#if href}}
###{{#unless major}}#{{/unless}} [{{title}}]({{href}})
{{else}}
#### {{title}}
{{/if}}

{{#if tag}}
> {{niceDate}}
{{/if}}

{{#if summary}}
{{summary}}
{{/if}}

{{#if fixes}}
Fixes:
{{#each fixes}}
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}} {{#each fixes}}#{{id}} {{/each}}
{{/each}}
{{/if}}

{{#if commits}}
Commits:
{{#each commits}}
- {{#if breaking}}**Breaking change:** {{/if}}{{subject}}{{#if href}} [`{{shorthash}}`]({{href}}){{/if}}
{{/each}}
{{/if}}

{{#if merges}}
PRs:
{{#each merges}}
- #{{id}} {{#if commit.breaking}}**Breaking change:** {{/if}}{{message}}
{{/each}}
{{/if}}

{{/each}}
40 changes: 31 additions & 9 deletions .github/workflows/release.yml
Expand Up @@ -7,25 +7,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x' # You might need to adjust this value to your own version
# Get the version number and put it in a variable
- name: Get Version
id: version
run: |
echo "::set-output name=tag::$(git describe --abbrev=0)"
node-version: '16.7'

# Build the plugin
- name: Build
id: build
env:
VERSION: ${{ github.ref_name }}
run: |
echo "Release ${VERSION}"
npm install
npm run build --if-present
npx auto-changelog --stdout --hide-credit --hide-empty-releases --template .github/changelog.hbs -v ${VERSION} --starting-version ${VERSION} > release-notes.md
echo "::set-output name=version::${VERSION}"
# Package the required files into a zip
- name: Package
run: |
Expand All @@ -41,7 +45,8 @@ jobs:
VERSION: ${{ github.ref }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: ./release-notes.md
draft: false
prerelease: false
# Upload the packaged release file
Expand All @@ -53,7 +58,7 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}-${{ steps.build.outputs.version }}.zip
asset_content_type: application/zip
# Upload the main.js
- name: Upload main.js
Expand All @@ -74,7 +79,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: manifest.json
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json
# Upload the style.css
Expand All @@ -88,3 +93,20 @@ jobs:
# asset_path: ./styles.css
# asset_name: styles.css
# asset_content_type: text/css
brat:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- env:
VERSION: ${{needs.build.outputs.version}}
run: |
echo $VERSION
sed -i 's|\(version":\) "[0-9\.]*"|\1 "'$VERSION'"|' manifest-beta.json
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "馃敤 brat release $VERSION"
git push
10 changes: 10 additions & 0 deletions manifest-beta.json
@@ -0,0 +1,10 @@
{
"id": "obsidian-task-collector",
"name": "Task Collector (TC)",
"version": "0.6.2",
"minAppVersion": "0.13.10",
"description": "Manage completed tasks within a document",
"author": "ebullient",
"authorUrl": "https://github.com/ebullient",
"isDesktopOnly": false
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"build": "node esbuild.config.mjs production",
"pretest": "eslint --ignore-path .gitignore src/",
"test": "jest",
"version": "auto-changelog -p && git add CHANGELOG.md"
"version": "auto-changelog -p --ignore-commit-pattern \\(changelog.*\\|Merge.*\\) && git add CHANGELOG.md"
},
"keywords": [
"obsidian",
Expand Down

0 comments on commit 3e23b49

Please sign in to comment.