Skip to content

Commit

Permalink
feat: add release pipeline & moving tags (#4)
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
MarcScheib authored Sep 6, 2024
1 parent c7587e0 commit 78ffc99
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 34 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/push_branch-main_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
branches:
- main
- master
- next
- next-major
- beta
- alpha
- '[0-9]+.[0-9]+.x'
- '[0-9]+.x'

env:
node-js-version: 20.x
author-name: Marc Scheib
author-email: marc.scheib@cycrilabs.com

jobs:
release:
name: Release
uses: CycriLabs/eam-gha-workflows/.github/workflows/dev-sec-ops_push_release.yml@1
with:
node-js-version: 20.x
# env vars can't be used here
author-name: Marc Scheib
author-email: marc.scheib@cycrilabs.com

tag:
name: Add additional tags
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0 # required to get all history for git describe

- name: Retrieve last tag
run: |
echo "TAG_MAJOR_MINOR=$(git describe --abbrev=0 --tags | cut -d. -f1,2)" >> $GITHUB_OUTPUT
echo "TAG_MAJOR=$(git describe --abbrev=0 --tags | cut -d. -f1)" >> $GITHUB_OUTPUT
id: version

- name: Add additional tags
run: |
git config --global user.name '${{ env.author-name }}'
git config --global user.email '${{ env.author-email }}'
git tag --force ${{ steps.version.outputs.TAG_MAJOR_MINOR }}
git tag --force ${{ steps.version.outputs.TAG_MAJOR }}
git push --tags --force
33 changes: 0 additions & 33 deletions .github/workflows/release.yml

This file was deleted.

14 changes: 13 additions & 1 deletion .releaserc
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
{
"branches": [
"main"
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"main",
"next",
"next-major",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down

0 comments on commit 78ffc99

Please sign in to comment.