-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.35 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy
on:
push:
tags:
- \d+\.\d+\.\d+
jobs:
deploy:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
restrictToTypes: feat,fix,refactor,perf
- name: Get latest tag
id: get-latest-tag
run: echo "LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: "docs: update CHANGELOG.md for ${{ github.ref_name }}"
file_pattern: CHANGELOG.md
- name: Create package
run: |
cd ${{ github.workspace }}
zip -r ./mod_darkmode-${{ env.LATEST_TAG }}.zip \
./* \
-x .github/ \
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: "Dark Mode Switcher v${{ env.LATEST_TAG }}"
body: ${{ steps.changelog.outputs.changes }}
files: ./mod_darkmode-${{ env.LATEST_TAG }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}