github.com/telepresenceio/telepresence/v2@v2.20.0-pro.6.0.20240517030216-236ea954e789/.github/workflows/release.yaml (about)

     1  name: Releases
     2  
     3  on:
     4    push:
     5      tags:
     6        # These aren't regexps. They are "Workflow Filter patterns"
     7        - v[0-9]+.[0-9]+.[0-9]
     8        - v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+
     9        - v[0-9]+.[0-9]+.[0-9]+-test.[0-9]+
    10  
    11  jobs:
    12    build-release:
    13      strategy:
    14        fail-fast: false
    15        matrix:
    16          runners:
    17            - ubuntu-latest
    18            - ubuntu-arm64
    19            - macos-latest
    20            - windows-2019
    21      runs-on: ${{ matrix.runners }}
    22      steps:
    23        - uses: actions/checkout@v4
    24          with:
    25            fetch-depth: 0
    26        - uses: ./.github/actions/install-dependencies
    27          name: install dependencies
    28        - name: set version
    29          shell: bash
    30          run: echo "TELEPRESENCE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
    31        - name: generate binaries
    32          run: make release-binary
    33        - name: Upload binaries
    34          uses: actions/upload-artifact@v3
    35          with:
    36            name: binaries
    37            path: build-output/release
    38            retention-days: 1
    39        - name: generate binaries darwin-amd64 # macos-latest is arm64, so we need an extra amd64 build
    40          if: runner.os == 'macOS'
    41          env:
    42            GOARCH: amd64
    43          run: make clean release-binary
    44        - name: Upload binaries darwin-amd64
    45          if: runner.os == 'macOS'
    46          uses: actions/upload-artifact@v3
    47          with:
    48            name: binaries
    49            path: build-output/release
    50            retention-days: 1
    51        - if: runner.os == 'Linux' && runner.arch == 'X64'
    52          uses: docker/setup-buildx-action@v3
    53          with:
    54            platforms: linux/amd64,linux/arm64
    55        - if: runner.os == 'Linux' && runner.arch == 'X64'
    56          name: Upload Docker image
    57          run: |
    58            docker login -u="${{ secrets.DOCKERHUB_USERNAME }}" -p="${{ secrets.DOCKERHUB_PASSWORD }}"
    59            make push-images-x
    60  
    61    publish-release:
    62      runs-on: ubuntu-latest
    63      needs: build-release
    64      steps:
    65        - name: Download artifacts
    66          uses: actions/download-artifact@v3
    67        - name: Determine if version is RC, TEST, or GA
    68          id: semver_check
    69          run: |
    70            if [[ "${{ github.ref_name }}" =~ ^v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+$ ]]; then
    71              echo "MAKE_LATEST=false" >> $GITHUB_ENV
    72              echo "DRAFT=false" >> $GITHUB_ENV
    73              echo "PRERELEASE=true" >> $GITHUB_ENV
    74            elif [[ "${{ github.ref_name }}" =~ ^v[0-9]+.[0-9]+.[0-9]+-test.[0-9]+$ ]]; then
    75              echo "MAKE_LATEST=false" >> $GITHUB_ENV
    76              echo "DRAFT=true" >> $GITHUB_ENV
    77              echo "PRERELEASE=false" >> $GITHUB_ENV
    78            else
    79              echo "MAKE_LATEST=true" >> $GITHUB_ENV
    80              echo "DRAFT=false" >> $GITHUB_ENV
    81              echo "PRERELEASE=false" >> $GITHUB_ENV
    82            fi
    83        - name: Create release
    84          uses: ncipollo/release-action@v1
    85          with:
    86            artifacts: "binaries/*"
    87            token: ${{ secrets.GITHUB_TOKEN }}
    88            prerelease: ${{ env.PRERELEASE }}
    89            makeLatest: ${{ env.MAKE_LATEST }}
    90            draft: ${{ env.DRAFT }}
    91            tag: ${{ github.ref_name }}
    92            body: |
    93              ## Official Release Artifacts
    94              ### Linux
    95                 - 📦 [telepresence-linux-amd64](https://app.getambassador.io/download/tel2oss/releases/download/${{ github.ref_name }}/telepresence-linux-amd64)
    96                 - 📦 [telepresence-linux-arm64](https://app.getambassador.io/download/tel2oss/releases/download/${{ github.ref_name }}/telepresence-linux-arm64)
    97              ### OSX Darwin
    98                 - 📦 [telepresence-darwin-amd64](https://app.getambassador.io/download/tel2oss/releases/download/${{ github.ref_name }}/telepresence-darwin-amd64)
    99                 - 📦 [telepresence-darwin-arm64](https://app.getambassador.io/download/tel2oss/releases/download/${{ github.ref_name }}/telepresence-darwin-arm64)
   100              ### Windows
   101                 - 📦 [telepresence-windows-amd64.zip](https://app.getambassador.io/download/tel2oss/releases/download/${{ github.ref_name }}/telepresence-windows-amd64.zip)
   102  
   103              For more builds across platforms and architectures, see the `Assets` section below.
   104              And for more information, visit our [installation docs](https://www.telepresence.io/docs/latest/quick-start/).
   105  
   106              ![Assets](https://static.scarf.sh/a.png?x-pxid=d842651a-2e4d-465a-98e1-4808722c01ab)
   107        - name: Notify Developers about Release
   108          id: slack
   109          uses: datawire/telepresence-internal-actions/slack-notification-release-success@main
   110          with:
   111            slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}
   112            telepresence_version: ${{ github.ref_name }}
   113            telepresence_product: "OSS"
   114  
   115    test-release:
   116      needs: publish-release
   117      strategy:
   118        fail-fast: false
   119        matrix:
   120          runners:
   121            - ubuntu-latest
   122            - ubuntu-arm64
   123            - macos-latest
   124            - macOS-arm64
   125            - windows-2019
   126      runs-on: ${{ matrix.runners }}
   127      steps:
   128        - uses: actions/checkout@v4
   129        - name: Test release
   130          uses: ./.github/actions/test-release
   131          with:
   132            release_version: ${{ github.ref_name }}