|
| 1 | +name: Create Release Pull Request |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ feature/**, bug/**, chore/** ] |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +jobs: |
| 12 | + create_release_pull_request: |
| 13 | + name: Create Release Pull Request |
| 14 | + runs-on: macOS-latest |
| 15 | + timeout-minutes: 30 |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Bundle install |
| 21 | + run: bundle install |
| 22 | + |
| 23 | + - name: Start Install Script for SwiftUI Template App |
| 24 | + run: swift run --package-path Scripts/Swift/iOSTemplateMaker iOSTemplateMaker make --bundle-id-production co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp --interface SwiftUI |
| 25 | + |
| 26 | + - name: Get release version |
| 27 | + run: | |
| 28 | + filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1) |
| 29 | + release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ') |
| 30 | + echo $release_version |
| 31 | + echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" |
| 32 | + echo $release_version |
| 33 | +
|
| 34 | + - uses: nimblehq/github-actions-workflows/[email protected] |
| 35 | + with: |
| 36 | + release_version: "1.0.0" |
| 37 | + changelog_configuration: ".github/workflows/configs/changelog-config.json" |
| 38 | + assignee: bot-nimble |
| 39 | + |
| 40 | + # create_bump_version_pull_request: |
| 41 | + # name: Create Bump Version Pull Request |
| 42 | + # runs-on: macos-latest |
| 43 | + # timeout-minutes: 30 |
| 44 | + # permissions: |
| 45 | + # contents: write |
| 46 | + # pull-requests: write |
| 47 | + # steps: |
| 48 | + # - name: Validate Version Input |
| 49 | + # run: | |
| 50 | + # if ! [[ "${{ github.event.inputs.nextVersion }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then |
| 51 | + # echo "Error: nextVersion must follow semantic versioning (e.g., 1.2.3)" |
| 52 | + # exit 1 |
| 53 | + # fi |
| 54 | + # - name: Create Bump Version branch |
| 55 | + # uses: peterjgrainger/[email protected] |
| 56 | + # env: |
| 57 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + # with: |
| 59 | + # branch: chore/bump-version-to-${{ github.event.inputs.nextVersion }} |
| 60 | + |
| 61 | + # - name: Checkout code |
| 62 | + # uses: actions/checkout@v4 |
| 63 | + # with: |
| 64 | + # ref: chore/bump-version-to-${{ github.event.inputs.nextVersion }} |
| 65 | + |
| 66 | + # - name: Bump version |
| 67 | + # run: | |
| 68 | + # filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1) |
| 69 | + # sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = ${{ github.event.inputs.nextVersion }};/g" $filename.xcodeproj/project.pbxproj |
| 70 | + |
| 71 | + # - name: Set up Git |
| 72 | + # run: | |
| 73 | + # git config --global user.name 'Github Actions' |
| 74 | + # git config --global user.email '[email protected]' |
| 75 | + |
| 76 | + # - name: Commit changes |
| 77 | + # run: | |
| 78 | + # git add . |
| 79 | + # git commit -m "[Chore] Bump version to ${{ github.event.inputs.nextVersion }}" |
| 80 | + # git push origin HEAD |
| 81 | + |
| 82 | + # - name: Create pull request |
| 83 | + # run: | |
| 84 | + # echo -e "## What happened 👀\n\nBump version to ${{ github.event.inputs.nextVersion }}" > body |
| 85 | + # export body=$(cat body) ; gh pr create --draft -B develop -H chore/bump-version-to-${{ github.event.inputs.nextVersion }} -t '[Chore] Bump version to ${{ github.event.inputs.nextVersion }}' -b "$body" |
| 86 | + # env: |
| 87 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments