-
Notifications
You must be signed in to change notification settings - Fork 72
62 lines (53 loc) · 1.83 KB
/
release-on-tag.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Release on tag
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Verify version
run: |
TAG=$(git describe --tags --abbrev=0)
VERSION=${TAG:1}
echo "TAG: $TAG"
echo "VERSION: $VERSION"
PKG_JSON_VERSION=$(jq -r '.version' <"$GITHUB_WORKSPACE/package.json")
if [ "$VERSION" != "$PKG_JSON_VERSION" ]; then
echo "Version in package.json ($PKG_JSON_VERSION) does not match tag ($VERSION)"
exit 1
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker image
run: |
shellcheck --version
yamllint -v
npm install
./fablo-build.sh --push
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
docs/schema.json
fablo.sh
- name: Create next development version PR
run: |
./bump_version.sh unstable
NEW_VERSION=$(jq -r '.version' <"$GITHUB_WORKSPACE/package.json")
BRANCH_NAME="bump-version-to-$NEW_VERSION"
git checkout -b $BRANCH_NAME
git commit -a -m "Set new development version: $NEW_VERSION"
git push --set-upstream origin bump-version-to-$NEW_VERSION
git gh pr create --title "Bump Version to $NEW_VERSION" --body "Bump Version to $NEW_VERSION" --label "bump-version-pr" --head "bump-version-to-$NEW_VERSION" --base main