From c4048b5dfdd79984d273f9e883592700da18b62f Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:39:29 -0300 Subject: [PATCH 1/6] build: add create release workflow --- .github/workflows/create_release.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/create_release.yml diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml new file mode 100644 index 0000000..a06b6bc --- /dev/null +++ b/.github/workflows/create_release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + # Triggers the workflow on pull request events to the main branch + pull_request: + branches: [ main ] + +jobs: + + release: + name: Create Release + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set release name + run: echo ::set-env name=RELEASE_NAME::$(echo ${GITHUB_REF:11}) + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: | + echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') + release_name: echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') + draft: false + prerelease: false \ No newline at end of file From faa5d27e62431d063aa1abdbe38ec2ede8e5e3e1 Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:39:41 -0300 Subject: [PATCH 2/6] build: bump version to 0.0.3 --- buildSrc/src/main/java/BuildConfigVersions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/BuildConfigVersions.kt b/buildSrc/src/main/java/BuildConfigVersions.kt index 928273f..acc1224 100644 --- a/buildSrc/src/main/java/BuildConfigVersions.kt +++ b/buildSrc/src/main/java/BuildConfigVersions.kt @@ -3,5 +3,5 @@ object BuildConfigVersions { const val minSdk = 23 const val targetSdk = 31 const val versionCode = 1 - const val versionName = "0.0.2" + const val versionName = "0.0.3" } From 6179bec91c8e4590f6e1d50926b00c534ede4bee Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:39:52 -0300 Subject: [PATCH 3/6] nit: clean validade pr file --- .github/workflows/create_release.yml | 8 ++++---- .github/workflows/validate_pr.yml | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index a06b6bc..4f15f45 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v2 - name: Set release name - run: echo ::set-env name=RELEASE_NAME::$(echo ${GITHUB_REF:11}) + run: echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') >> $RELEASE_NAME - name: Create Release id: create_release @@ -24,8 +24,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: | - echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') - release_name: echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') + tag_name: ${{ $RELEASE_NAME }} + + release_name: ${{ $RELEASE_NAME }} draft: false prerelease: false \ No newline at end of file diff --git a/.github/workflows/validate_pr.yml b/.github/workflows/validate_pr.yml index e885dc9..2f344ff 100644 --- a/.github/workflows/validate_pr.yml +++ b/.github/workflows/validate_pr.yml @@ -1,8 +1,7 @@ -# Controls when the workflow will run name: Validate PR on: - # Triggers the workflow on pull request events to the develop branch + # Triggers the workflow on pull request events to the main branch pull_request: branches: [ main ] From dcbfe1d737833846dddeae7454a93dbe034f69c4 Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:53:42 -0300 Subject: [PATCH 4/6] feat: set release name --- .github/workflows/create_release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 4f15f45..a60b7a6 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v2 - name: Set release name - run: echo v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }') >> $RELEASE_NAME + run: echo "release_name=v$(cat buildSrc/src/main/java/BuildConfigVersions.kt | grep versionName | awk '{print substr($5, 2, length($5)-2) }')" >> $GITHUB_ENV - name: Create Release id: create_release @@ -24,8 +24,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ $RELEASE_NAME }} + tag_name: ${{ env.release_name }} - release_name: ${{ $RELEASE_NAME }} + release_name: ${{ env.release_name }} draft: false prerelease: false \ No newline at end of file From 4ec32749c3d35a32c408de7510a8ad74181ddc56 Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:56:31 -0300 Subject: [PATCH 5/6] build: change workflow trigger action --- .github/workflows/create_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index a60b7a6..ada6e1b 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -2,7 +2,7 @@ name: Release on: # Triggers the workflow on pull request events to the main branch - pull_request: + push: branches: [ main ] jobs: From ae015cd06c99f13ea96b2df04f9d0bab227711cc Mon Sep 17 00:00:00 2001 From: Felipe Castilhos Date: Fri, 19 Nov 2021 00:59:21 -0300 Subject: [PATCH 6/6] build: bump version name to 0.0.4 --- buildSrc/src/main/java/BuildConfigVersions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/BuildConfigVersions.kt b/buildSrc/src/main/java/BuildConfigVersions.kt index acc1224..1e695fb 100644 --- a/buildSrc/src/main/java/BuildConfigVersions.kt +++ b/buildSrc/src/main/java/BuildConfigVersions.kt @@ -3,5 +3,5 @@ object BuildConfigVersions { const val minSdk = 23 const val targetSdk = 31 const val versionCode = 1 - const val versionName = "0.0.3" + const val versionName = "0.0.4" }