Merge pull request #490 from hyperledger-labs/set-version-2.0.0 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |