Skip to content

Commit 9d948ce

Browse files
authored
Merge pull request #2 from alhankeser/feature/releases
Add release automation
2 parents e39ae17 + 72288ac commit 9d948ce

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Latest Version
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Bump version and push tag
14+
id: tag_version
15+
uses: mathieudutour/github-tag-action@v6.2
16+
with:
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Release new version
19+
uses: ncipollo/release-action@v1
20+
with:
21+
tag: ${{ steps.tag_version.outputs.new_tag }}
22+
name: Release ${{ steps.tag_version.outputs.new_tag }}
23+
body: ${{ steps.tag_version.outputs.changelog }}
24+
- name: Get major version
25+
id: major_version
26+
run: |
27+
echo "major_version=$(echo ${{ steps.tag_version.outputs.new_tag }} | cut -d. -f1)" >> $GITHUB_OUTPUT
28+
- name: Retag
29+
run: |
30+
git tag -f latest || true
31+
git tag -f ${{ steps.major_version.outputs.major_version }} || true
32+
git push -f --tags || true

.github/workflows/tag-dev.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Tag Dev
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Retag
13+
run: |
14+
git tag -f dev || true
15+
git push -f --tags || true

0 commit comments

Comments
 (0)