Skip to content

Commit 1caf7dd

Browse files
committed
feat:add release image
Signed-off-by: Chen Kai <281165273grape@gmail.com>
1 parent ca22f09 commit 1caf7dd

2 files changed

Lines changed: 157 additions & 0 deletions

File tree

.github/config/configuration.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## 🚀 Features",
5+
"labels": [
6+
"feat"
7+
]
8+
},
9+
{
10+
"title": "## 🐛 Fixes",
11+
"labels": [
12+
"fix"
13+
]
14+
},
15+
{
16+
"title": "## 🧰 Maintenance",
17+
"labels": [
18+
"chore"
19+
]
20+
},
21+
{
22+
"title": "## 🧪 Tests",
23+
"labels": [
24+
"test"
25+
]
26+
},
27+
{
28+
"title": "## 🖍️ Documentation",
29+
"labels": [
30+
"doc",
31+
"docs"
32+
]
33+
},
34+
{
35+
"title": "## 📦 Dependencies",
36+
"labels": [
37+
"deps",
38+
"dependencies",
39+
"chore(deps)"
40+
]
41+
},
42+
{
43+
"title": "## 💬 Other",
44+
"labels": [
45+
"other",
46+
"misc"
47+
]
48+
}
49+
],
50+
"sort": "ASC",
51+
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
52+
"pr_template": "${{TITLE}}",
53+
"empty_template": "- no changes",
54+
"label_extractor": [
55+
{
56+
"pattern": "(.+): (.+)",
57+
"target": "$1"
58+
}
59+
],
60+
"exclude_merge_branches": [
61+
"merge pull request",
62+
"Merge pull request"
63+
]
64+
}

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: shisui image
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: write
17+
18+
env:
19+
releaseBuild: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
20+
REGISTRY: ghcr.io
21+
IMAGE_NAME: ${{ github.repository }}
22+
23+
jobs:
24+
25+
push_image_to_github:
26+
name: Push Docker image to Github
27+
runs-on: ubuntu-latest
28+
permissions: write-all
29+
steps:
30+
- name: Check out the repo
31+
uses: actions/checkout@v4
32+
- name: Log in to Docker Hub
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Extract metadata (tags, labels) for Docker
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.REGISTRY }}/${{ github.repository }}
44+
tags: |
45+
type=semver,pattern={{raw}}
46+
47+
- name: Build and push Docker image
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
file: ./Dockerfile.portal
52+
push: true
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
56+
57+
release:
58+
name: 🚰 Release new version.
59+
needs: push_image_to_github
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: 🛎️Check out the source code
64+
uses: actions/checkout@v3
65+
with:
66+
fetch-depth: 0
67+
submodules: recursive
68+
69+
- name: ⚙️Build Changelog
70+
id: github_release
71+
uses: mikepenz/release-changelog-builder-action@v4
72+
with:
73+
configuration: ".github/config/configuration.json"
74+
commitMode: true
75+
ignorePreReleases: ${{ !contains(github.ref, '-') }}
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: ⏬Download all the build artifacts
80+
uses: actions/download-artifact@v3
81+
with:
82+
path: release-artifacts
83+
84+
- name: ✨Github Release
85+
uses: softprops/action-gh-release@v1
86+
with:
87+
body: ${{ steps.github_release.outputs.changelog }}
88+
files: |
89+
${{ github.workspace }}/release-artifacts/**
90+
generate_release_notes: true
91+
fail_on_unmatched_files: true
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)