Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
soffokl authored Jan 18, 2024
2 parents 6bca1f3 + 44e2e74 commit 25f0ae0
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Released

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Get Release
run: |
echo $RELEASE_VERSION
echo ${{ env.RELEASE_VERSION }}
- name: Checkout tools repo
uses: actions/checkout@v4
with:
repository: mysteriumnetwork/mysterium-mobile-provider
ref: 'master'
path: mobile-app
token: ${{ secrets.REPO_TOKEN }}

- name: Update version
run: |
APP_VERSION=$(echo "$(grep "versionName" "./mobile-app/android/app/build.gradle.kts" | awk -F '"' '{print $2}')" + 0.1 | bc)
sed -i -E "/versionName\s*=\s*\"[0-9]+\.[0-9]+\"/s/\"[0-9]+\.[0-9]+\"/\"$APP_VERSION\"/" "./mobile-app/android/app/build.gradle.kts"
sed -i -E "/node\s*=\s*\"[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?\"/s/\"[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?\"/\"${{ env.RELEASE_VERSION }}\"/" "./mobile-app/android/gradle/libs.versions.toml"
- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.REPO_TOKEN }}
with:
source-directory: mobile-app
destination-github-username: 'MysteriumTeam'
destination-repository-name: 'mysterium-mobile-provider'
user-email: [email protected]
commit-message: Create release version ${{ env.RELEASE_VERSION }}
target-branch: master

- name: "Call Bitrise API"
uses: indiesdev/[email protected]
with:
url: https://api.bitrise.io/v0.1/apps/${{ secrets.BITRISE_APP_ID }}/builds
method: "POST"
id: api
accept: 200, 201
headers: '{ "accept": "application/json", "Authorization": "${{ secrets.BITRISE_TOKEN }}", "Content-Type": "application/json" }'
body: '{ "hook_info": {"type": "bitrise"}, "build_params": {"branch":"master", "workflow_id":"build"}}'
timeout: 10000
log-response: true

- name: "Bitrise response"
run: echo ${{ steps.api.outputs.response }}

0 comments on commit 25f0ae0

Please sign in to comment.