Skip to content

Commit

Permalink
ci: added release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
szattila98 committed Jun 30, 2023
1 parent 9eb54ac commit 249e3c4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 5 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config --global user.email github-actions@github.com
git config --global user.name github-actions
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Install cargo-edit
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-edit

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Bump
id: release
uses: cocogitto/cocogitto-action@v3.4
with:
check-latest-tag-only: true
release: true
git-user: "github-actions"
git-user-email: "github-actions@github.com"

- name: Generate Changelog
run: cog changelog --at ${{ steps.release.outputs.version }} -t full_hash > GITHUB_CHANGELOG.md

- name: Upload github release
uses: softprops/action-gh-release@v1
with:
body_path: GITHUB_CHANGELOG.md
tag_name: ${{ steps.release.outputs.version }}
2 changes: 1 addition & 1 deletion .github/workflows/vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand Down
10 changes: 6 additions & 4 deletions cog.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from_latest_tag = false
ignore_merge_commits = true
branch_whitelist = ["main"]
pre_bump_hooks = []
post_bump_hooks = []
post_bump_hooks = [
"git push",
"git push origin {{version}}"
]

[commit_types]

Expand All @@ -20,8 +22,8 @@ authors = [
[bump_profiles]

[packages]
client = { path = "client", pre_bump_hooks = [ "npm version {{version}}" ] }
server = { path = "server", pre_bump_hooks = [ "cargo set-version {{version}}" ] }
client = { path = "client", pre_bump_hooks = [ "npm version {{version}}", "npm run build" ] }
server = { path = "server", pre_bump_hooks = [ "cargo set-version {{version}}", "cargo build --release" ] }

[git_hooks.pre-push]
script = """#!/bin/sh
Expand Down

0 comments on commit 249e3c4

Please # to comment.