Skip to content

Commit

Permalink
chore(github-action): refactor release process
Browse files Browse the repository at this point in the history
Details:
 - commit on master generates a new version based on semvers
 - commit on PR generates a dev release
  • Loading branch information
o-orand committed Jan 23, 2024
1 parent 37ada75 commit adaa883
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 115 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/auto-release-on-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: auto-release

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0

- name: Bump version and push tag
id: bump-version
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: master
noVersionBumpBehavior: patch
majorList: major

- name: create bosh release
id: create-bosh-release
uses: orange-cloudfoundry/[email protected]
with:
target_branch: ${{github.ref_name}}
tag_name: ${{ steps.bump-version.outputs.next}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_BOSH_ACCES_KEY_ID: ${{ secrets.AWS_BOSH_ACCES_KEY_ID }}
AWS_BOSH_SECRET_ACCES_KEY: ${{ secrets.AWS_BOSH_SECRET_ACCES_KEY }}

# see https://github.com/ncipollo/release-action
- name: create github release
id: create-github-release
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0
with:
tag: ${{ steps.create-bosh-release.outputs.tagged_version }}
draft: false
allowUpdates: false # > indicates if we should update a release if it already exists.
generateReleaseNotes: true
artifacts: ./${{ steps.create-bosh-release.outputs.file }}
artifactContentType: application/zip
artifactErrorsFailBuild: true # > indicates if artifact read or upload errors should fail the build.
28 changes: 0 additions & 28 deletions .github/workflows/bump-version.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: create-dev-release
name: create-dev-release-on-PR

on:
push:
branches:
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# *: Matches zero or more characters, but does not match the / character. For example, Octo* matches Octocat.
# **: Matches zero or more of any character.
branches-ignore:
- master
tags-ignore:
- '*'

jobs:
build:
Expand Down Expand Up @@ -47,7 +46,7 @@ jobs:
# and if clause https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif
- name: create bosh dev release
id: create-bosh-release
uses: orange-cloudfoundry/bosh-release-action@8732ff085712d9980fc66e50892cb9c3d7a3f884 # v2 # will create dev release when pushed git ref is not a tag
uses: orange-cloudfoundry/create-bosh-release-action@v1.0.1 # will create dev release when pushed git ref is not a tag
with:
target_branch: ${{github.ref_name}}
env:
Expand All @@ -68,10 +67,3 @@ jobs:
name: archive-bosh-dev-release-tgz
path: |
k3s-*.tgz
- name: Bump version and push tag
uses: anothrNick/github-tag-action@a2c70ae13a881faf2b4953baaa9e49731997ab36 # 1.67.0 # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: false
DEFAULT_BUMP: none
74 changes: 0 additions & 74 deletions .github/workflows/on-tags.yml

This file was deleted.

0 comments on commit adaa883

Please sign in to comment.