Skip to content

Commit

Permalink
Merge pull request #11 from felipecastilhos/build/create_release
Browse files Browse the repository at this point in the history
Criar release ao fazer push na main
  • Loading branch information
felipecastilhos committed Nov 19, 2021
2 parents 0998250 + ae015cd commit 25e1fa2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
# Triggers the workflow on pull request events to the main branch
push:
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 "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
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.release_name }}

release_name: ${{ env.release_name }}
draft: false
prerelease: false
3 changes: 1 addition & 2 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -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 ]

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/BuildConfigVersions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.4"
}

0 comments on commit 25e1fa2

Please sign in to comment.