Skip to content

Commit

Permalink
[PCE-2803] add simple release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszancukiewicz committed Feb 5, 2024
1 parent 15a5774 commit e7f27b8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and release
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'Release: ')"
steps:
- uses: actions/checkout@v3
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Get app version
id: app_version
run: echo "APP_VERSION=$(./gradlew version --no-daemon --console=plain -q)" >> $GITHUB_OUTPUT
- name: Check release with local version
if: ${{ github.event.head_commit.message != format('Release: {0}', steps.app_version.outputs.APP_VERSION) }}
run: |
echo "Local version doesn't match commit version"
exit 1
- name: Run test
run: ./gradlew test
- name: Create release in artifactory
env:
REPOSITORY_USERNAME: ${{ secrets.REPOSITORY_USERNAME }}
REPOSITORY_PASSWORD: ${{ secrets.REPOSITORY_PASSWORD }}
run: |
./gradlew assembleRelease assembleReleaseUnitTest \
-PrepositoryUserName=${{ env.REPOSITORY_USERNAME }} \
-PrepositoryPassword=${{ env.REPOSITORY_PASSWORD }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run tests
on: [push, pull_request]
jobs:
macos:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 0 additions & 4 deletions artifactory/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ publishing {
}
}





artifactory {
contextUrl = repositoryPath

Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ tasks.register('clean', Delete) {
delete rootProject.buildDir
}

tasks.register("version") {
println(versionName)
}

project.ext {
//libraries
multidexVersion = "2.0.1"
Expand Down

0 comments on commit e7f27b8

Please sign in to comment.