Skip to content

Bump VERSION to 2.0.3 #2

Bump VERSION to 2.0.3

Bump VERSION to 2.0.3 #2

Workflow file for this run

name: Release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.actor != 'protegeproject-bot[bot]' }}
outputs:
version: ${{ steps.release-version.outputs.version }}
service: webprotege-nginx
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PROTEGEPROJECT_BOT_APP_ID }}
private-key: ${{ secrets.PROTEGEPROJECT_BOT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
- name: Read release version
id: release-version
run: |
version=$(cat VERSION | tr -d '[:space:]')
echo "Release version: $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Tag release commit
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.release-version.outputs.version }}
git push origin ${{ steps.release-version.outputs.version }}
- name: Build and push Docker image
run: |
docker build -t protegeproject/webprotege-nginx:${{ steps.release-version.outputs.version }} .
docker push protegeproject/webprotege-nginx:${{ steps.release-version.outputs.version }}
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release-version.outputs.version }}
generate_release_notes: true
# After the release, bump the patch version in VERSION so the next
# merge to main produces a new release. For example, after
# releasing 2.0.2 the file is set to 2.0.3.
- name: Bump VERSION for next release
run: |
released=${{ steps.release-version.outputs.version }}
IFS='.' read -r -a parts <<< "$released"
parts[2]=$((parts[2] + 1))
next="${parts[0]}.${parts[1]}.${parts[2]}"
echo "Next version: $next"
echo "$next" > VERSION
git add VERSION
git commit -m "Bump VERSION to $next"
git push origin HEAD:${GITHUB_REF##*/}
notify-bump:
needs: build
uses: ./.github/workflows/notify-deploy-project.yaml
with:
version: ${{ needs.build.outputs.version }}
service: ${{ needs.build.outputs.service }}
branch_var: ${{ vars.BUMP_WEBPROTEGE_BRANCH }}
secrets:
PROTEGE_PROJECT_CLIENT_ID: ${{ secrets.PROTEGE_PROJECT_CLIENT_ID }}
PROTEGE_PROJECT_CLIENT_SECRET: ${{ secrets.PROTEGE_PROJECT_CLIENT_SECRET }}