Skip to content

Commit

Permalink
gitflow release via github action
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed May 3, 2024
1 parent 01b1711 commit e12f48b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 18 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/gitflow-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: GitFlow Release

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
environment:
name: Production
url: "https://brdgm.me/${{ steps.package_json.outputs.appDeployName }}"

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- run: npm ci
- run: npm run test:unit
- run: npm run build

- name: Install git flow extensions
run: |
sudo apt-get install git-flow
- name: Read properties from package.json
id: package_json
uses: zoexx/[email protected]
with:
file_path: package.json

- run: git flow init --defaults
- run: git flow release start ${{ steps.package_json.outputs.version }}
- run: git flow release finish ${{ steps.package_json.outputs.version }} --push --message "Release"

- name: Copy to Site
uses: cpina/[email protected]
env:
API_TOKEN_GITHUB: ${{ secrets.GH_SITE_DEPLOY_PAT }}
with:
source-directory: dist
destination-repository-username: brdgm
destination-repository-name: brdgm.github.io
destination-github-username: ${{ secrets.GH_SITE_DEPLOY_USERNAME }}
user-email: ${{ secrets.GH_SITE_DEPLOY_EMAIL }}
user-name: ${{ secrets.GH_SITE_DEPLOY_NAME }}
target-branch: main
commit-message: deploy ${{ steps.package_json.outputs.appDeployName }} ${{ steps.package_json.outputs.version }}
target-directory: ${{ steps.package_json.outputs.appDeployName }}

- name: set next version
run: |
npm --no-git-tag-version version patch
git config user.name "GitHub Actions"
git config user.email [email protected]
git add package.json package-lock.json
git commit --message "set next version"
git push
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.package_json.outputs.version }}
generateReleaseNotes: true
18 changes: 0 additions & 18 deletions .github/workflows/release-from-tag.yml

This file was deleted.

0 comments on commit e12f48b

Please sign in to comment.