Skip to content

fix workflow not creating a tag #16

fix workflow not creating a tag

fix workflow not creating a tag #16

Workflow file for this run

name: Build with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
logLevel:
description: 'Start Build'
required: true
default: 'warning'
tags:
required: false
description: 'Start Build'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Build with Maven (BungeeCord)
run: cd bungeecord && mvn clean package -T4
- name: Build with Maven (Velocity)
run: cd velocity && mvn clean package -T4
- name: Get the current commit SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git tag release-${{ steps.vars.outputs.sha_short }}
git push origin release-${{ steps.vars.outputs.sha_short }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ steps.vars.outputs.sha_short }}
name: Release ${{ steps.vars.outputs.sha_short }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload BungeeCord JAR
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ steps.vars.outputs.sha_short }}
files: bungeecord/target/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Velocity JAR
uses: softprops/action-gh-release@v1
with:
tag_name: release-${{ steps.vars.outputs.sha_short }}
files: velocity/target/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}