github.com/dominant-strategies/go-quai@v0.28.2/.github/workflows/cut-minor-release.yml (about)

     1  name: Cut a new Minor Release Branch
     2  on: workflow_dispatch
     3  jobs:
     4    cutReleaseCandidate:
     5      runs-on: ubuntu-latest
     6      outputs:
     7        branch: ${{ steps.set-branch.outputs.branch }}
     8      steps:
     9      - uses: actions/checkout@v3
    10        with:
    11          ref: ${{ inputs.branch }}
    12          ssh-key: ${{ secrets.GH_PAT }}
    13  
    14        # Import the GPG key for signing Git commits and tags
    15      - name: Import GPG key
    16        uses: crazy-max/ghaction-import-gpg@v5
    17        with:
    18          gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
    19          git_user_signingkey: true
    20          git_tag_gpgsign: true
    21          git_commit_gpgsign: true
    22  
    23      - name: get Version
    24        run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
    25  
    26      - name: Update version environment variable
    27        run: echo "VERSION=$(echo $VERSION | sed 's/pre/rc/g' | awk -F. '{print $1"."$2"."$3"."0}')" >> $GITHUB_ENV
    28  
    29      - name: Update 'VERSION' file
    30        run: echo "$VERSION" > VERSION
    31  
    32      - name: Update Chart.yaml version
    33        run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
    34  
    35      - name: Update values.yaml version
    36        run: yq eval -P -i ".goQuai.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml
    37  
    38      - name: Update version environment variable e.g. v0.1.0-pre.0 -> v0.1
    39        run: echo "BRANCH=$(echo $VERSION | sed 's/\.[0-9]*-.*//g')" >> $GITHUB_ENV
    40  
    41      - name: Store version in branch variable
    42        id: set-branch
    43        run: echo "::set-output name=branch::${{ env.BRANCH }}"
    44  
    45      - uses: stefanzweifel/git-auto-commit-action@v4
    46        with:
    47          commit_message: Rev'd 'VERSION' file to ${{ env.VERSION }}
    48          branch: ${{ env.BRANCH }}
    49          create_branch: true
    50          commit_options: -S
    51          commit_user_email: ci@dominantstrategies.io
    52          commit_user_name: ci-dominantstrategies
    53  
    54  
    55      - uses: actions/checkout@v3
    56        with:
    57          ref: ${{ inputs.branch }}
    58          ssh-key: ${{ secrets.GH_PAT }}
    59  
    60      - name: get Version
    61        run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
    62  
    63      - name: Update version environment variable
    64        run: echo "VERSION=$(echo $VERSION | sed "s/-.*//g" | awk -F. '{print $1"."$2+1"."0"-pre.0"}')" >> $GITHUB_ENV
    65  
    66      - name: Update 'VERSION' file
    67        run: echo "$VERSION" > VERSION
    68  
    69      - name: Update Chart.yaml version
    70        run: yq eval -P -i ".appVersion=\"${{ env.VERSION }}\"" ./helm/Chart.yaml
    71  
    72      - name: Update values.yaml version
    73        run: yq eval -P -i ".goQuai.image.version=\"${{ env.VERSION }}\"" ./helm/values.yaml
    74  
    75      - uses: stefanzweifel/git-auto-commit-action@v4
    76        with:
    77          commit_message: Cut ${{ env.BRANCH }} release branch and rev'd 'VERSION' file to ${{ env.VERSION }}
    78          branch: main
    79          commit_options: -S
    80          commit_user_email: ci@dominantstrategies.io
    81          commit_user_name: ci-dominantstrategies
    82    deployReleaseCandidate:
    83      uses: ./.github/workflows/build-deploy.yml
    84      secrets:
    85        DOCKER: ${{ secrets.DOCKER }}
    86        GH_PAT: ${{ secrets.GH_PAT }}
    87        GKE_SA_KEY: ${{ secrets.GKE_SA_KEY }}
    88        GKE_PROJECT: ${{ secrets.GKE_PROJECT }}
    89        GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
    90        GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
    91      with:
    92        env: quai-sandbox
    93        awk : sed -e "s/pre/rc/g" | awk -F . '{print $1"."$2"."$3"."$4+1}'
    94        rails: '[[ ! "$VERSION" =~ "pre" ]]'
    95        branch: ${{ needs.cutReleaseCandidate.outputs.branch }}
    96      needs: [cutReleaseCandidate]