Skip to content

CI Test

CI Test #35

Workflow file for this run

name: CI
on:
push:
branches:
- 'dev/**'
- 'exp/**'
paths:
- '*.gradle'
- 'gradle.properties'
- 'src/**'
- 'versions/**'
- '.github/**'
release:
types:
- published
pull_request:
jobs:
prepare_build_info:
if: ${{ !startsWith(github.event.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
outputs:
build_type: ${{ steps.build_type.outputs.version_type }}
build_publish: ${{ steps.build_type.outputs.build_publish }}
steps:
- name: Checkout the sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determining build type
id: build_type
run: |
if [ ${{ github.event_name }} == 'push' ]
then
echo 'build_publish=true' >> $GITHUB_OUTPUT
echo 'version_type=BETA' >> $GITHUB_OUTPUT
elif [ ${{ github.event_name }} == 'release' ]
then
echo 'build_publish=true' >> $GITHUB_OUTPUT
echo 'version_type=RELEASE' >> $GITHUB_OUTPUT
elif [ ${{ github.event_name }} == 'pull_request' ]
then
echo 'build_publish=false' >> $GITHUB_OUTPUT
echo 'version_type=DEV' >> $GITHUB_OUTPUT
else
echo Unknown github event name $GITHUB_EVENT_NAME
exit 1
fi
- name: Read Properties mod info
id: mod_info
uses: christian-draeger/[email protected]
with:
path: gradle.properties
properties: 'mod.name mod.version'
build:
if: ${{ contains(github.event.head_commit.message, '[build skip]') == false }}
needs:
- prepare_build_info
uses: ./.github/workflows/build.yml
secrets: inherit
with:
build_type: ${{ needs.prepare_build_info.outputs.build_type }}
publish:
if: ${{ needs.prepare_build_info.outputs.build_publish == 'true' }}
needs:
- prepare_build_info
- build
uses: ./.github/workflows/publish.yml
secrets: inherit
with:
build_type: ${{ needs.prepare_build_info.outputs.build_type }}