Skip to content

Commit

Permalink
fix: change release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanti committed Sep 9, 2024
1 parent 9f7609c commit 17d06a5
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
name: Continuous Delivery

permissions:
pull-requests: write
contents: write

on:
push:
tags:
- "v*.*.*"
- "v*"

env:
CARGO_TERM_COLOR: always

jobs:
build-and-upload:
name: Build and upload
create-release:
name: Create release
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate a changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --latest
env:
OUTPUT: CLIFF.md
GITHUB_REPO: ${{ github.repository }}

- name: Create release
uses: softprops/action-gh-release@v2
with:
body_path: CLIFF.md

build-release:
name: Build release and upload assets
needs: ['create-release']

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -67,14 +90,20 @@ jobs:
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a "$dirname.zip" "$dirname"
shasum -a 256 "$dirname.tar.gz" > "$dirname.tar.gz.sha256"
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
echo "ASSET_SUM=$dirname.tar.gz.sha256" >> $GITHUB_ENV
else
tar -czf "$dirname.tar.gz" "$dirname"
shasum -a 256 "$dirname.tar.gz" > "$dirname.tar.gz.sha256"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
echo "ASSET_SUM=$dirname.tar.gz.sha256" >> $GITHUB_ENV
fi
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}
- name: Upload release archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
version="${{ env.VERSION }}"
gh release upload "$version" ${{ env.ASSET }} ${{ env.ASSET_SUM }}

0 comments on commit 17d06a5

Please sign in to comment.