Skip to content

Commit

Permalink
!!release
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Oct 20, 2022
1 parent 05a3ce0 commit 3d1091c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
56 changes: 51 additions & 5 deletions .github/workflows/test-and-stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test-and-stage
name: ci

on:
push:
Expand Down Expand Up @@ -56,10 +56,6 @@ jobs:

steps:
- uses: actions/checkout@master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Setup JDK
uses: actions/setup-java@master
with:
Expand Down Expand Up @@ -89,3 +85,53 @@ jobs:
target_branch: staging
github_token: ${{ github.token }}


release-flag:
if: contains(github.event.head_commit.message, '!!release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master



gh-release:
needs: [release-flag, to-staging]
timeout-minutes: 10

runs-on: ubuntu-latest

strategy:
steps:
- uses: actions/checkout@master
- name: Setup JDK
uses: actions/setup-java@master
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Get the project version
id: get_version
run: |
git fetch --all --tags
VERSION=$(./gradlew properties | grep version | awk '{print $2}')
echo "Version $VERSION"
[[ ! $A =~ .*SNAPSHOT.* ]] # check it's not a snapshot version
[[ -z $(git tag -l $VERSION) ]] # check this version was not published
echo "result=$VERSION" >>$GITHUB_OUTPUT
- name: Build
run: |
export GPG_TTY=$(tty)
./gradlew uberJar
mv ./build/libs/mavence.uber.jar ./build/libs/mavence.jar
env:
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
MAVEN_GPG_PASSWORD: ${{ secrets.MAVEN_GPG_PASSWORD }}
- name: Publish GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.result }}
files: ./build/libs/mavence.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = "io.github.rtmigo"
version = "1.0-SNAPSHOT"
version = "0.1.0" // -SNAPSHOT

repositories {
mavenCentral()
Expand Down

0 comments on commit 3d1091c

Please sign in to comment.