github.com/hazelops/ize@v1.1.12-0.20230915191306-97d7c0e48f11/.github/workflows/release-prod.build-and-publish.yml (about)

     1  name: "Release prod: Build & Publish Artifacts"
     2  concurrency:
     3    group: ${{ github.workflow }}
     4    cancel-in-progress: false
     5  on:
     6    release:
     7      types: [created]
     8  
     9  jobs:
    10    build:
    11      if: startsWith(github.ref, 'refs/tags/0.0.0-dev') != true
    12      runs-on: ubuntu-latest
    13      steps:
    14      - name: Install Go
    15        uses: actions/setup-go@v2
    16        with:
    17         go-version: 1.18.x
    18  
    19      - name: Checkout code
    20        uses: actions/checkout@v2
    21        with:
    22          fetch-depth: 0
    23  
    24      - name: Set env
    25        run: |
    26          echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
    27          echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
    28  
    29      # TODO: This should run only if all tests are satisfying
    30      - name: Run GoReleaser
    31        uses: goreleaser/goreleaser-action@v2
    32        with:
    33          # either 'goreleaser' (default) or 'goreleaser-pro'
    34          distribution: goreleaser
    35          version: latest
    36          args: release -f .goreleaser.yml --rm-dist
    37        env:
    38          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    39          HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
    40          RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
    41          FURY_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }}
    42          SHORT_SHA: ${{ env.SHORT_SHA }}
    43  
    44      - name: create docs
    45        run: |
    46          mkdir -p commands
    47          go run ./cmd gen doc
    48  
    49      - name: Pushes ize commands to ize.sh
    50        uses: dmnemec/copy_file_to_another_repo_action@main
    51        env:
    52          API_TOKEN_GITHUB: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
    53        with:
    54          source_file: 'website/commands'
    55          destination_repo: 'hazelops/ize.sh'
    56          destination_folder: 'content'
    57          user_email: 'ize@hazelops.com'
    58          user_name: 'ize'
    59          commit_message: 'Add commands from Ize'
    60  
    61    create_jira_release:
    62      needs: build
    63      runs-on: ubuntu-latest
    64      steps:
    65        - name: create release
    66          uses: Rorychan/jira-releases-action@v1
    67          continue-on-error: true
    68          with:
    69            jira-server: 'https://hazelops.atlassian.net'
    70            jira-email: 'dmitry@hazelops.com'
    71            jira-api-token: ${{ secrets.JIRA_API_TOKEN }}
    72            project-name: 'IZE'
    73            release-name: ${{ github.event.release.name }}
    74            is-released: true
    75  
    76        - name: Sleep for 7 minutes
    77          uses: whatnick/wait-action@master
    78          with:
    79            time: '7m'