Skip to content

Commit

Permalink
chore: add release-builder workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mbreithecker committed Jul 6, 2022
1 parent e9bc331 commit 4c00c76
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 64 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"categories": [
{
"title": "### Features",
"labels": ["feat"]
},
{
"title": "### Improvements",
"labels": ["chore"]
},
{
"title": "### Fixes",
"labels": ["fix"]
}
],
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>",
"pr_template": "- ${{TITLE}}",
"empty_template": "- no changes",
"label_extractor": [
{
"pattern": "(chore|fix|feat)!?: (.*)",
"target": "$1",
"flags": "gu"
}
],
"transformers": [
{
"pattern": "(chore|fix|feat)!?: (.*)",
"target": "$2"
}
]
}
99 changes: 35 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,41 @@
name: Release

on:
release:
types: [released]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

push:
# Pattern matched against refs/tags
tags:
- '*' # Push events to every tag not containing /
name: Create Release Binaries
jobs:
binaries:
name: Build release binaries.
generate:
name: Create release-artifacts
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3

- name: Install yarn.
run: npm install -g yarn
- name: Install dependencies.
run: yarn install
- name: Build.
run: yarn build:binaries

- uses: actions/upload-artifact@v3
- name: Checkout the repository
uses: actions/checkout@main
- name: Build Binaries
run: |
yarn install
yarn build
yarn build:binaries
cd out
zip kyve-linux.zip kyve-linux
rm kyve-linux
zip kyve-macos.zip kyve-macos
rm kyve-macos
cd ..
- name: Generate Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
with:
name: kyve-solana-linux
path: ./out/solana-linux
- uses: actions/upload-artifact@v3
configuration: ".github/workflows/configuration.json"
commitMode: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish the Release
uses: softprops/action-gh-release@v1
with:
name: kyve-solana-macos
path: ./out/solana-macos
- uses: actions/upload-artifact@v3
with:
name: kyve-solana-win
path: ./out/solana-win.exe

docker:
name: Build and publish Docker container.
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to Docker.
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Build the Docker image.
run: docker build -t kyve/solana:${GITHUB_REF#refs/tags/} -t kyve/solana:latest .

- name: Push to Docker hub.
run: docker push -a kyve/solana

webhook:
name: Post a message to Discord.
needs: [binaries, docker]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3

- name: Install yarn.
run: npm install -g yarn
- name: Install dependencies.
run: yarn install

- name: Run script.
run: DISCORD=${{ secrets.DISCORD }} VERSION=${GITHUB_REF#refs/tags/} node .github/webhook.js
body: ${{steps.github_release.outputs.changelog}}
tag_name: ${{ steps.vars.outputs.tag_name }}
files: out/*
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4c00c76

Please sign in to comment.