Skip to content

ci: Fix incorrent log message #617

ci: Fix incorrent log message

ci: Fix incorrent log message #617

Workflow file for this run

name: Release
on:
pull_request: {}
push:
tags:
- "release/*"
permissions:
contents: write
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CHECKSEC_VERSION: 2.5.0
RUSTFLAGS: "-D warnings -A deprecated"
RUSTUP_MAX_RETRIES: 10
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
meta:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- id: meta
shell: bash
run: |
shopt -s extglob
ref="${{ github.ref }}"
if [[ "$ref" == refs/tags/release/* ]]; then
ver="${ref##refs/tags/release/}"
if [[ "$ver" != v+([0-9]).+([0-9]).+([0-9])?(-+([a-z0-9-])) ]]; then
echo "Invalid version: $ver" >&2
exit 1
fi
( echo publish=true
echo version="${ver#v}"
echo archs='["amd64", "arm64", "arm"]'
) >> "$GITHUB_OUTPUT"
else
sha="${{ github.sha }}"
( echo version="0.0.0-test.${sha:0:7}"
echo archs='["amd64"]'
) >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- id: changed
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11
with:
files: |
.github/workflows/release.yml
justfile
Cargo.toml
outputs:
changed: ${{ steps.changed.outputs.any_changed }}
archs: ${{ steps.meta.outputs.archs }}
publish: ${{ steps.meta.outputs.publish }}
version: ${{ steps.meta.outputs.version }}
package:
needs: [meta]
if: needs.meta.outputs.changed == 'true'
strategy:
matrix:
arch: ${{ fromJson(needs.meta.outputs.archs) }}
libc: [gnu] # musl
# If we're not actually building on a release tag, don't short-circuit on
# errors. This helps us know whether a failure is platform-specific.
continue-on-error: ${{ !needs.meta.outputs.publish }}
runs-on: ubuntu-latest
timeout-minutes: 40
container: docker://ghcr.io/linkerd/dev:v43-rust-musl
env:
LINKERD2_PROXY_VENDOR: ${{ github.repository_owner }}
LINKERD2_PROXY_VERSION: ${{ needs.meta.outputs.version }}
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just fetch
- run: just arch=${{ matrix.arch }} libc=${{ matrix.libc }} rustup
- run: just arch=${{ matrix.arch }} libc=${{ matrix.libc }} profile=release build
- run: just arch=${{ matrix.arch }} libc=${{ matrix.libc }} profile=release package
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: ${{ matrix.arch }}-artifacts
path: target/package/*
publish:
if: needs.meta.outputs.changed == 'true'
needs: [meta, package]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
path: artifacts
- run: du -h artifacts/**/*
- if: needs.meta.outputs.publish == 'true'
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
name: v${{ needs.meta.outputs.version }}
files: artifacts/**/*
generate_release_notes: true