Skip to content

Commit

Permalink
Merge pull request #1 from ImDevinC/autotag
Browse files Browse the repository at this point in the history
Testing new workflows
  • Loading branch information
ImDevinC committed Jan 28, 2024
2 parents ee65875 + ef02e28 commit f02417a
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 33 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/chart-release.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/merge-bump-semver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Bump SemVer Tags

on:
push:
branches:
- master

jobs:
check-pr:
uses: ./.github/workflows/shared-bump-semver-tags.yaml
9 changes: 9 additions & 0 deletions .github/workflows/pr-validate-semver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Validate release info

on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize, ready_for_review]

jobs:
check-pr:
uses: ./.github/workflows/shared-validate-semver-tags.yaml
54 changes: 54 additions & 0 deletions .github/workflows/shared-bump-semver-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Bump SemVer Tags

on:
workflow_call:
inputs:
include-v-prefix:
description: "Include V prefix on published version"
default: true
required: false
type: boolean

jobs:
bump-tag-version:
name: Bump and tag version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.bump.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate PR metadata
uses: jefflinse/pr-semver-bump@v1.6.0
id: bump
with:
mode: bump
repo-token: ${{ secrets.GITHUB_TOKEN }}
minor-label: minor
major-label: major
patch-label: patch
with-v: ${{ inputs.include-v-prefix }}
update-major-version:
name: Update major version
needs:
- bump-tag-version
runs-on: ubuntu-latest
if: needs.bump-tag-version.outputs.version != ''
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Parse major version
id: parse
run: |
VERSION=${{ needs.bump-tag-version.outputs.version }}
VERSION="${VERSION#[vV]}"
MAJOR_VERSION="${VERSION%%\.*}"
echo ::set-output name=major-version::${MAJOR_VERSION}
- name: Republish major version
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git tag -fa v${{ steps.parse.outputs.major-version }} -m "Update v${{ steps.parse.outputs.major-version }} tag"
git push origin v${{ steps.parse.outputs.major-version }} --force
10 changes: 10 additions & 0 deletions .github/workflows/shared-chart-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Release Chart

on:
workflow_dispatch:

jobs:
release:
permissions:
contents: write
uses: imdevinc/imdevinc/.github/workflows/chart-release.yaml@v1
File renamed without changes.
22 changes: 22 additions & 0 deletions .github/workflows/shared-validate-semver-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Validate PR metadata

on:
workflow_call:

jobs:
check-pr:
name: Validate release label and notes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate PR metadata
uses: jefflinse/pr-semver-bump@v1.6.0
with:
mode: validate
repo-token: ${{ secrets.GITHUB_TOKEN }}
minor-label: minor
major-label: major
patch-label: patch

0 comments on commit f02417a

Please sign in to comment.