Skip to content

Commit

Permalink
new workflow to update master
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsitoPuglisi committed Jul 1, 2024
1 parent 17b16c5 commit 9a21b6a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 18 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/pre-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ jobs:
uses: ./.github/workflows/build-rc-workflow.yml
secrets: inherit
with:
version_of_rc: ${{ github.event.inputs.version_to_release }}
version_of_rc: ${{ github.event.inputs.version_to_release }}

next-version:
name: Set Next Version
needs: release-branch
uses: ./.github/workflows/set-version.yml
secrets: inherit
with:
new_version: ${{ github.event.inputs.next_version }}"
18 changes: 1 addition & 17 deletions .github/workflows/rc-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ jobs:
git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0"
git push --set-upstream origin release/${{ github.event.inputs.version_to_release }}
- name: Set next SDK version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push
- name: Checkout Swazzler
uses: actions/checkout@v4
with:
Expand All @@ -71,12 +63,4 @@ jobs:
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.version_to_release }}.0#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: change version to be released: ${{ github.event.inputs.version_to_release }}.0"
git push --set-upstream origin release/${{ github.event.inputs.version_to_release }}
- name: Set Next Swazzler Version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push
git push --set-upstream origin release/${{ github.event.inputs.version_to_release }}
54 changes: 54 additions & 0 deletions .github/workflows/set-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Set Next Version in SDK and Swazzler

on:
workflow_call:
inputs:
version:
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'New version, Specify <major.minor>, e.g. 6.4 (Do NOT include -SNAPSHOT, will be added automatically)'
required: true

jobs:
set-version:
name: Set Version in SDK
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Configure git
run: |
git config --global user.name 'embrace-ci[bot]'
git config --global user.email 'embrace-ci@users.noreply.github.com'
git config --global url."https://${{ secrets.CD_GITHUB_USER }}:${{ secrets.CD_GITHUB_TOKEN }}@github.com".insteadOf "https://github.com"
- name: Checkout SDK
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.CD_GITHUB_TOKEN }}

- name: Set new SDK version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set new version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push
- name: Checkout Swazzler
uses: actions/checkout@v4
with:
repository: embrace-io/embrace-swazzler3
ref: master
token: ${{ secrets.CD_GITHUB_TOKEN }}

- name: Set Next Swazzler Version
run: |
git checkout master
sed -i -r "s#version = ([^\']+)#version = ${{ github.event.inputs.next_version }}.0-SNAPSHOT#" gradle.properties
git add gradle.properties
git commit -m "CI/CD: set next version: ${{ github.event.inputs.next_version }}.0-SNAPSHOT"
git push

0 comments on commit 9a21b6a

Please sign in to comment.