Skip to content

Update issue templates #58

Update issue templates

Update issue templates #58

Workflow file for this run

name: Upgrade Version and Deploy
on:
pull_request:
types:
- closed
branches:
- 'main'
jobs:
upgrade-version:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.merged == true }}
permissions:
contents: write
steps:
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Check out the repo and login with bot account
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21.0.3'
cache: 'maven'
cache-dependency-path: 'server/pom.xml'
- name: Setup Git
env:
GIT_AUTHOR_NAME: GitHub Actions
GIT_AUTHOR_EMAIL: "[email protected]"
run: |
git config --global user.name "${{env.GIT_AUTHOR_NAME}}"
git config --global user.email "${{env.GIT_AUTHOR_EMAIL}}"
- name: Retrieve versions
id: versions
shell: bash
run: |
VERSIONS=$(scripts/retrieve-versions.sh server/pom.xml)
NEXT_VERSION=$(echo $VERSIONS | cut -d ':' -f 1)
NEW_SNAPSHOT=$(echo $VERSIONS | cut -d ':' -f 2)
echo "next_version=$(echo $VERSIONS | cut -d ':' -f 1)" >> $GITHUB_OUTPUT
echo "new_snapshot=$(echo $VERSIONS | cut -d ':' -f 2)" >> $GITHUB_OUTPUT
- name: Upgrade server pom version to ${{ steps.versions.outputs.next_version }}
shell: bash
run: |
mvn versions:set -DnewVersion=${{ steps.versions.outputs.next_version }} --file server/pom.xml
- name: Upgrade version in README.md
shell: bash
run: |
sed -i 's/https:\/\/img.shields.io\/badge\/Version-[0-9]\+\.[0-9]\+\.[0-9]-blue/https:\/\/img.shields.io\/badge\/Version-${{ steps.versions.outputs.next_version }}-blue/g' README.md
sed -i 's/image: heavynimbus\/heavy-mock-http-server:[0-9]\+\.[0-9]\+\.[0-9]/image: heavynimbus\/heavy-mock-http-server:${{ steps.versions.outputs.next_version }}/g' README.md
- name: Git Add changes
run: git add server/pom.xml README.md
- name: Git Commit changes
run: git commit -m "🚀⬆️ Upgrade version to ${{ steps.versions.outputs.next_version }}"
- name: Git Tag ${{ steps.versions.outputs.next_version }}
run: git tag ${{ steps.versions.outputs.next_version }} HEAD
- name: Git Push changes and tags
with:
token: ${{ secrets.GITHUB_TOKEN }}
run: git push --force origin HEAD:${{ github.ref_name }} --tags

Check failure on line 81 in .github/workflows/upgrade-version.yml

View workflow run for this annotation

GitHub Actions / Upgrade Version and Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/upgrade-version.yml (Line: 81, Col: 9): Unexpected value 'run' .github/workflows/upgrade-version.yml (Line: 78, Col: 9): Required property is missing: uses
- name: Build Docker image ${{ steps.versions.outputs.next_version }}
env:
NEXT_VERSION: ${{ steps.versions.outputs.next_version }}
run: |
docker build -t heavy-mock-http-server:$NEXT_VERSION server
- name: Push Docker image ${{ steps.versions.outputs.next_version }}
env:
NEXT_VERSION: ${{ steps.versions.outputs.next_version }}
run: |
docker tag "heavy-mock-http-server:$NEXT_VERSION" "heavynimbus/heavy-mock-http-server:$NEXT_VERSION"
docker push "heavynimbus/heavy-mock-http-server:$NEXT_VERSION"
- name: Set snapshot version
run: |
mvn versions:set -DnewVersion=${{ steps.versions.outputs.new_snapshot }} --file server/pom.xml
- name: Git Add changes
run: git add server/pom.xml
- name: Git Commit changes
run: git commit -m "⬆️ Upgrade version to ${{ steps.versions.outputs.new_snapshot }}"
- name: Git Push changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
run: git push --force origin HEAD:${{ github.ref_name }}