forked from tim3z/SudoQ
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
72 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,6 @@ on: | |
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
#print inputs | ||
printInputs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "Log level: ${{ github.event.inputs.changeSeverity }}" | ||
increase-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -61,10 +54,10 @@ jobs: | |
git add -A | ||
NEW_VERSION_CODE=${{ steps.increase_version_code.outputs.new_version_code }} | ||
NEW_VERSION_NAME=${{ steps.increase_version_name.outputs.new_version_name }} | ||
git commit -m "version bump: code: ${NEW_VERSION_CODE}, name: ${NEW_VERSION_NAME}" -a | ||
git commit -m "Version bump: code: ${NEW_VERSION_CODE}, name: ${NEW_VERSION_NAME}" -a | ||
# - name: push changes | ||
# uses: ad-m/[email protected] | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# branch: ${{ github.ref }} | ||
- name: push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: 'bump versionCode, versionName, commit' | ||
|
||
on: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
changeSeverity: | ||
description: 'how severe are the changes? chose from (M)ajor, (m)inor, (p)atch, or write out the new version' | ||
required: true | ||
default: 'p' | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
increase-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: increase version code | ||
id: increase_version_code | ||
env: | ||
FILE: sudoq-app/sudoqapp/src/main/AndroidManifest.xml | ||
run: | | ||
echo "$(pwd)" | ||
echo "get line number" | ||
LINE_NUMBER=$(grep -n "android:versionCode=" $FILE | cut -f1 -d:) | ||
echo "get version" | ||
VERSION=$(sed -n ${LINE_NUMBER}p $FILE | grep -oE '[0-9]+') | ||
echo "current version: ${VERSION}" | ||
echo "replace version" | ||
NEW_VERSION_CODE=$((VERSION+1)) | ||
echo "new version code: ${NEW_VERSION_CODE}" | ||
sed -i "${LINE_NUMBER}s/${VERSION}/${NEW_VERSION_CODE}/" $FILE | ||
echo "::set-output name=new_version_code::$NEW_VERSION_CODE" | ||
- name: commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add -A | ||
NEW_VERSION_CODE=${{ steps.increase_version_code.outputs.new_version_code }} | ||
git commit -m "Version code bump: code: ${NEW_VERSION_CODE}" -a | ||
- name: push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} |