Skip to content

fix(.github): package ID for release workflow (#396) #35

fix(.github): package ID for release workflow (#396)

fix(.github): package ID for release workflow (#396) #35

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
defaults:
run:
working-directory: ./cli
permissions:
contents: write # To write to release
id-token: write # To deploy to GitHub Pages
pages: write # To deploy to GitHub Pages
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
# See details fore GitHub Actions runners
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
- os: ubuntu-20.04
rust_target: x86_64-unknown-linux-gnu
ext: ""
args: ""
- os: macos-latest
rust_target: x86_64-apple-darwin
ext: ""
args: ""
- os: macos-14 # beta (Apple Silicon)
rust_target: aarch64-apple-darwin
ext: ""
args: ""
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
ext: ".exe"
args: ""
- os: windows-latest
rust_target: aarch64-pc-windows-msvc
ext: ".exe"
args: "--no-default-features --features native-tls-vendored"
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo build --package commitlint-rs --release
- run: tar czvf commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz -C target/release commitlint${{ matrix.config.ext }}
- uses: actions/upload-artifact@v4
with:
name: commitlint-${{ matrix.config.rust_target }}
path: commitlint-${{ github.ref_name }}-${{ matrix.config.rust_target }}.tar.gz
if-no-files-found: error
crate:
runs-on: ubuntu-latest
environment: crate
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- run: cargo publish --package commitlint-rs
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
docker:
runs-on: ubuntu-latest
environment: docker
steps:
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: 1915keke/commitlint
tags: |
type=raw,value=latest
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
publish:
runs-on: ubuntu-latest
needs:
- build
- crate
- docker
- schema
- web
steps:
- uses: actions/download-artifact@v4
with:
path: commitlint
pattern: commitlint-*
merge-multiple: true
- uses: ncipollo/release-action@v1
with:
artifacts: commitlint/commitlint-*.tar.gz,schema.json
generateReleaseNotes: true
schema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: cargo run --package schema -- --path schema.json
- uses: actions/upload-artifact@v4
with:
name: schema.json
path: schema.json
if-no-files-found: error
web:
runs-on: ubuntu-latest
environment:
name: web
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: withastro/action@v2
with:
path: ./web
- id: deployment
uses: actions/deploy-pages@v4