Skip to content

Commit

Permalink
Improve the release pipeline (#210)
Browse files Browse the repository at this point in the history
* fix release pipeline

* output tag

* tag_name

* fix

* improve name

* run bash

* remove pack.sh

* resolve comment
  • Loading branch information
tian-lt authored Dec 3, 2024
1 parent f554819 commit 1ac3fab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 50 deletions.
59 changes: 12 additions & 47 deletions .github/workflows/pipeline-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,31 @@ name: Proxy-Release

on:
workflow_dispatch:
inputs:
version:
description: 'Release version (x.x.x)'
required: true
default: '0.0.0'

jobs:
run-bvt-gcc:
name: Run BVT with GCC
uses: ./.github/workflows/bvt-gcc.yml

run-bvt-clang:
name: Run BVT with Clang
uses: ./.github/workflows/bvt-clang.yml

run-bvt-msvc:
name: Run BVT with MSVC
uses: ./.github/workflows/bvt-msvc.yml

run-bvt-appleclang:
name: Run BVT with AppleClang
uses: ./.github/workflows/bvt-appleclang.yml

run-bvt-nvhpc:
name: Run BVT with NVHPC
uses: ./.github/workflows/bvt-nvhpc.yml

report:
uses: ./.github/workflows/bvt-report.yml
name: Generate report
needs: [run-bvt-gcc, run-bvt-clang, run-bvt-msvc, run-bvt-appleclang, run-bvt-nvhpc]

draft-release:
name: Draft release
permissions:
contents: write
runs-on: ubuntu-24.04
needs: report
steps:
- uses: actions/checkout@v4

- name: create tag
- name: pack source
id: run-pack
run: |
git checkout -b release/${{ github.event.inputs.version }}
sed -i 's/VERSION 0\.1\.0 # local build version/VERSION ${{ github.event.inputs.version }}/' CMakeLists.txt
git config --local user.email "[email protected]"
git config --local user.name "release bot"
git add CMakeLists.txt
git commit -m "Release version ${{ github.event.inputs.version }}"
git tag ${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
- name: create tgz archive
run: tar -czf "proxy-${{ github.event.inputs.version }}.tgz" "proxy.h"
file="CMakeLists.txt"
version=$(grep -oP 'msft_proxy\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' "$file")
git tag "$version"
git push origin "$version"
tar -czf "proxy-$version.tgz" "proxy.h"
echo "PRO_VER=$version" >> $GITHUB_OUTPUT
shell: bash

- name: create release draft
uses: softprops/action-gh-release@v2
with:
draft: true
files: proxy-${{ github.event.inputs.version }}.tgz
name: Proxy ${{ github.event.inputs.version }} Release
tag_name: ${{ github.event.inputs.version }}
tag_name: ${{ steps.run-pack.outputs.PRO_VER }}
files: proxy-*.tgz
name: Proxy ${{ steps.run-pack.outputs.PRO_VER }} Release
generate_release_notes: true
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(msft_proxy
VERSION 0.1.0 # local build version
LANGUAGES CXX)
project(msft_proxy VERSION 0.1.0 LANGUAGES CXX)
add_library(msft_proxy INTERFACE)
target_compile_features(msft_proxy INTERFACE cxx_std_20)
target_include_directories(msft_proxy INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down

0 comments on commit 1ac3fab

Please sign in to comment.