Skip to content

Commit

Permalink
feat(ci): update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRichardH committed Sep 24, 2023
1 parent 549b4e0 commit 83203b1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 33 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Action - Trigger Release

on:
workflow_dispatch:
branches: ["fix/ci__fix_release_flow"]

jobs:
bump:
name: Bump version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Cocogitto release
id: release
uses: oknozor/[email protected]
with:
release: true
git-user: "release-bot"
git-user-email: "[email protected]"

- name: Print version
run: "echo '${{ steps.release.outputs.version }}'"

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

- name: Generate current version
run: echo ${{ steps.release.outputs.version }} > ./build/version

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
draft: false
delete-branch: true
signoff: false
base: main
branch: "release/${{ steps.release.outputs.version }}"
commit-message: "release(version): bump to ${{ steps.release.outputs.version }}"
title: "release(version): Bump to ${{ steps.release.outputs.version }}"
body-path: ./docs/LATEST_CHANGELOG.md
50 changes: 17 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,30 @@
name: Release
Name: Release

on:
workflow_dispatch:
branches: ["fix/ci__fix_release_flow"]
pull_request:
types:
- closed
branches:
- "release/**"
paths:
- "Cargo.toml"

jobs:
release:
name: Perform release
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Cocogitto release
id: release
uses: oknozor/[email protected]
with:
release: true
git-user: "release-bot"
git-user-email: "[email protected]"
- name: Checkout
uses: actions/checkout@v3

- name: Print version
run: "echo '${{ steps.release.outputs.version }}'"

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

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
draft: false
delete-branch: true
signoff: false
base: main
branch: "release/${{ steps.release.outputs.version }}"
commit-message: "release(version): bump to ${{ steps.release.outputs.version }}"
title: "release(version): Bump to ${{ steps.release.outputs.version }}"
body-path: ./docs/LATEST_CHANGELOG.md
- name: Set output variables
id: vars
run: |
version="$(cat ./build/version)"
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Upload github release
uses: softprops/action-gh-release@v1
with:
body_path: ./docs/LATEST_CHANGELOG.md
tag_name: ${{ steps.release.outputs.version }}
tag_name: ${{ steps.vars.outputs.version }}

0 comments on commit 83203b1

Please sign in to comment.