ci: update workflows config. #429
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm install | |
- run: npm run build | |
# - run: mkdir -p build | |
# - run: npm i markdown-to-html-cli -g | |
# - run: markdown-to-html --output build/index.html --github-corners https://github.com/jaywcjlove/changelog-generator | |
- name: Create idoc config | |
run: | | |
cat > idoc.yml << EOF | |
site: "Create Tag {{version}}" | |
menus: | |
Home: index.html | |
Sponsor: https://jaywcjlove.github.io/#/sponsor | |
footer: | | |
<a href="https://jaywcjlove.github.io/#/sponsor" target="_blank">Sponsor</a> • | |
<a href="https://jaywcjlove.github.io/create-tag-action" target="_blank">Create Tag</a> • | |
<a href="https://jaywcjlove.github.io/github-action-contributors" target="_blank">Contributors</a> • | |
<a href="https://jaywcjlove.github.io/github-action-read-file" target="_blank">Read File Content</a> • | |
<a href="https://jaywcjlove.github.io/generated-badges" target="_blank">Generated Badges</a> | |
<br /> | |
Released under the MIT License. Copyright © {{idocYear}} Kenny Wong<br /> | |
Generated by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a> v{{idocVersion}} | |
EOF | |
- run: npm install idoc@1 -g | |
- run: idoc | |
- name: Generate Contributors Images | |
uses: jaywcjlove/github-action-contributors@main | |
with: | |
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\]) | |
output: dist/CONTRIBUTORS.svg | |
avatarSize: 42 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
- name: Create Tag | |
id: create_tag | |
uses: jaywcjlove/create-tag-action@main | |
with: | |
package-path: ./package.json | |
- name: Generate Changelog | |
id: changelog | |
# uses: jaywcjlove/changelog-generator@main | |
uses: ./ | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head-ref: ${{steps.create_tag.outputs.version}} | |
original-markdown: true | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
- run: echo "outputs.changelog - ${{ steps.changelog.outputs.changelog }}" | |
- run: echo "outputs.tag - ${{ steps.changelog.outputs.tag }}" | |
- run: echo "outputs.branch - ${{ steps.changelog.outputs.branch }}" | |
- run: echo "outputs.compareurl - ${{ steps.changelog.outputs.compareurl }}" | |
- run: echo "outputs.version - ${{ steps.changelog.outputs.version }}" | |
- run: echo "outputs.gh-pages-hash - ${{ steps.changelog.outputs.gh-pages-hash }}" | |
- run: echo "outputs.gh-pages-hash - ${{ steps.changelog.outputs['gh-pages-hash'] }}" | |
- run: echo "outputs.gh-pages-short-hash - ${{ steps.changelog.outputs.gh-pages-short-hash }}" | |
- name: Generate Changelog (path test) | |
id: changelog_path | |
# uses: jaywcjlove/changelog-generator@main | |
uses: ./ | |
with: | |
path: ./.github/workflows/changelog.yml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head-ref: ${{steps.create_tag.outputs.version}} | |
original-markdown: true | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
- name: Generate Changelog (show-emoji test) | |
# uses: jaywcjlove/changelog-generator@main | |
id: changelogEmoji | |
uses: ./ | |
with: | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
show-emoji: false | |
remove-type: true | |
- name: Order Changelog (ASC) | |
uses: ./ | |
with: | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
show-emoji: false | |
remove-type: true | |
order: 'asc' | |
- name: Order Changelog (DESC) | |
uses: ./ | |
with: | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
show-emoji: false | |
remove-type: true | |
order: 'desc' | |
- name: Generate Changelog (outputs.changelog) | |
run: echo "${{ steps.changelogEmoji.outputs.changelog }}" | |
- name: Generate Changelog(main) | |
uses: jaywcjlove/changelog-generator@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head-ref: ${{steps.create_tag.outputs.version}} | |
filter-author: (小弟调调™|Renovate Bot) | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
- name: Generate Changelog(custom-emoji test) | |
uses: ./ | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
head-ref: ${{steps.create_tag.outputs.version}} | |
filter-author: (小弟调调™|Renovate Bot) | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
custom-emoji: 'type🐝,feat💄,fix🆎' | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
if: steps.create_tag.outputs.successful | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ steps.create_tag.outputs.version }} | |
tag: ${{ steps.create_tag.outputs.version }} | |
body: | | |
```yml | |
- name: Generate changelog | |
id: changelog | |
uses: jaywcjlove/changelog-generator@${{ steps.create_tag.outputs.version }} | |
with: | |
token: # Your GITHUB_TOKEN | |
filter-author: (jaywcjlove|小弟调调™|dependabot\[bot\]|Renovate Bot) | |
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' | |
``` | |
${{ steps.changelog.outputs.compareurl }} | |
${{ steps.changelog.outputs.changelog }} | |
Document Website: https://raw.githack.com/jaywcjlove/changelog-generator/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html |