v5.60.0 #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| workflow_dispatch: null | |
| release: | |
| types: [ published ] | |
| jobs: | |
| notify: | |
| needs: pypi-release | |
| if: github.repository == 'linode/linode-cli' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Notify Slack - Main Message | |
| id: main_message | |
| uses: slackapi/slack-github-action@v2.1.0 | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.CLI_SLACK_CHANNEL_ID }} | |
| blocks: | |
| - type: section | |
| text: | |
| type: mrkdwn | |
| text: "*New Release Published: _linode-cli_ <${{ github.event.release.html_url }}|${{ github.event.release.tag_name }}> is now live!* :tada:" | |
| oci_publish: | |
| name: Build and publish the OCI image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone Repository | |
| uses: actions/checkout@v4 | |
| - name: setup python 3 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install deps | |
| run: make requirements | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # pin@v3.6.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # pin@v3.11.1 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # pin@v3.4.0 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # This is necessary as we want to ensure that version tags | |
| # are properly formatted before passing them into the | |
| # DockerFile. | |
| - uses: actions/github-script@v7 | |
| id: cli_version | |
| with: | |
| script: | | |
| let tag_name = '${{ github.event.release.tag_name }}'; | |
| if (tag_name.startsWith("v")) { | |
| tag_name = tag_name.slice(1); | |
| } | |
| return tag_name; | |
| result-encoding: string | |
| - name: Build and push to DockerHub | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # pin@v6.18.0 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: linode/cli:${{ steps.cli_version.outputs.result }},linode/cli:latest | |
| build-args: | | |
| linode_cli_version=${{ steps.cli_version.outputs.result }} | |
| github_token=${{ secrets.GITHUB_TOKEN }} | |
| pypi-release: | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| environment: pypi-release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python deps | |
| run: pip install wheel | |
| - name: Install package requirements | |
| run: make requirements | |
| - name: Build the package | |
| run: make build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| LINODE_CLI_VERSION: ${{ github.event.release.tag_name }} | |
| - name: Publish the release artifacts to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # pin@release/v1.12.4 |