diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..95a0d34 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml index 411c325..ce30707 100644 --- a/.github/workflows/vue.yml +++ b/.github/workflows/vue.yml @@ -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 }} diff --git a/cog.toml b/cog.toml index bf009a4..294c7ef 100644 --- a/cog.toml +++ b/cog.toml @@ -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] @@ -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