Skip to content

Commit 0bbfa0c

Browse files
committed
chore: add release-builder workflow
1 parent 43407b7 commit 0bbfa0c

2 files changed

Lines changed: 67 additions & 64 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "### Features",
5+
"labels": ["feat"]
6+
},
7+
{
8+
"title": "### Improvements",
9+
"labels": ["chore"]
10+
},
11+
{
12+
"title": "### Fixes",
13+
"labels": ["fix"]
14+
}
15+
],
16+
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
17+
"pr_template": "- ${{TITLE}}",
18+
"empty_template": "- no changes",
19+
"label_extractor": [
20+
{
21+
"pattern": "(chore|fix|feat)!?: (.*)",
22+
"target": "$1",
23+
"flags": "gu"
24+
}
25+
],
26+
"transformers": [
27+
{
28+
"pattern": "(chore|fix|feat)!?: (.*)",
29+
"target": "$2"
30+
}
31+
]
32+
}

.github/workflows/release.yml

Lines changed: 35 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,41 @@
1-
name: Release
2-
31
on:
4-
release:
5-
types: [released]
6-
7-
# Allows you to run this workflow manually from the Actions tab
8-
workflow_dispatch:
9-
2+
push:
3+
# Pattern matched against refs/tags
4+
tags:
5+
- '*' # Push events to every tag not containing /
6+
name: Create Release Binaries
107
jobs:
11-
binaries:
12-
name: Build release binaries.
8+
generate:
9+
name: Create release-artifacts
1310
runs-on: ubuntu-latest
14-
1511
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-node@v3
18-
19-
- name: Install yarn.
20-
run: npm install -g yarn
21-
- name: Install dependencies.
22-
run: yarn install
23-
- name: Build.
24-
run: yarn build:binaries
25-
26-
- uses: actions/upload-artifact@v3
12+
- name: Checkout the repository
13+
uses: actions/checkout@main
14+
- name: Build Binaries
15+
run: |
16+
yarn install
17+
yarn build
18+
yarn build:binaries
19+
cd out
20+
zip kyve-linux.zip kyve-linux
21+
rm kyve-linux
22+
zip kyve-macos.zip kyve-macos
23+
rm kyve-macos
24+
cd ..
25+
- name: Generate Changelog
26+
id: github_release
27+
uses: mikepenz/release-changelog-builder-action@v3
2728
with:
28-
name: kyve-bitcoin-linux
29-
path: ./out/bitcoin-linux
30-
- uses: actions/upload-artifact@v3
29+
configuration: ".github/workflows/configuration.json"
30+
commitMode: true
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Publish the Release
34+
uses: softprops/action-gh-release@v1
3135
with:
32-
name: kyve-bitcoin-macos
33-
path: ./out/bitcoin-macos
34-
- uses: actions/upload-artifact@v3
35-
with:
36-
name: kyve-bitcoin-win.exe
37-
path: ./out/bitcoin-win.exe
38-
39-
docker:
40-
name: Build and publish Docker container.
41-
runs-on: ubuntu-latest
42-
43-
steps:
44-
- uses: actions/checkout@v2
45-
46-
- name: Login to Docker.
47-
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
48-
49-
- name: Build the Docker image.
50-
run: docker build -t kyve/bitcoin:${GITHUB_REF#refs/tags/} -t kyve/bitcoin:latest .
51-
52-
- name: Push to Docker hub.
53-
run: docker push -a kyve/bitcoin
54-
55-
webhook:
56-
name: Post a message to Discord.
57-
needs: [binaries, docker]
58-
runs-on: ubuntu-latest
59-
60-
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions/setup-node@v3
63-
64-
- name: Install yarn.
65-
run: npm install -g yarn
66-
- name: Install dependencies.
67-
run: yarn install
68-
69-
- name: Run script.
70-
run: DISCORD=${{ secrets.DISCORD }} VERSION=${GITHUB_REF#refs/tags/} node .github/webhook.js
36+
body: ${{steps.github_release.outputs.changelog}}
37+
tag_name: ${{ steps.vars.outputs.tag_name }}
38+
files: out/*
39+
prerelease: false
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)