diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..5633bae --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build & Release + +on: + push: + branches: + - master + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: https://git.oryfox.de/actions/checkout@v4 + + - name: Set up JDK + uses: https://git.oryfox.de/actions/setup-java@v4 + with: + java-version: 25 + distribution: corretto + + - name: Set up Maven + uses: https://git.oryfox.de/actions/setup-maven@v5 + with: + maven-version: 3.9.14 + + - name: Build with Maven + run: mvn -B clean package + + - name: Set release tag to current datetime + id: datetime + run: | + TAG_NAME="$(date -u '+%Y%m%d%H%M%S')" + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT + + - name: Create Release + uses: https://git.oryfox.de/actions/gitea-release-action@v1 + with: + files: target/inventory-tools.jar + token: ${{ secrets.REPOSITORY_TOKEN }} + tag_name: ${{ steps.datetime.outputs.TAG_NAME }} + name: ${{ steps.datetime.outputs.TAG_NAME }} \ No newline at end of file