Skip to content

Commit

Permalink
Fix release pipeline (#203)
Browse files Browse the repository at this point in the history
Co-authored-by: Tian L. <60599517+tian-lt@users.noreply.github.com>
  • Loading branch information
mingxwa and tian-lt authored Nov 21, 2024
1 parent 0b075c7 commit 68af9c8
Showing 1 changed file with 22 additions and 67 deletions.
89 changes: 22 additions & 67 deletions .github/workflows/pipeline-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,102 +9,57 @@ on:
default: '0.0.0'

jobs:
prepare-release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: create release branch
run: |
git checkout -b release/${{ github.event.inputs.version }}
- name: assign cmake version
run: "((Get-Content -Path CMakeLists.txt -Raw) -Replace 'VERSION 0.1.0 # local build version','VERSION ${{ github.event.inputs.version }}') | Set-Content -Path CMakeLists.txt -NoNewLine"

- name: commit changes
run: |
git config --local user.email "release-bot@no.email.com"
git config --local user.name "release bot"
git add CMakeLists.txt
git commit -m 'assign a release version'
- name: new git tag
run: |
git tag ${{ github.event.inputs.version }}
- name: push git objects
run: |
git push origin release/${{ github.event.inputs.version }}
git push origin ${{ github.event.inputs.version }}
run-bvt-gcc:
needs: prepare-release
name: Run BVT with GCC
uses: ./.github/workflows/bvt-gcc.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-clang:
needs: prepare-release
name: Run BVT with Clang
uses: ./.github/workflows/bvt-clang.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-msvc:
needs: prepare-release
name: Run BVT with MSVC
uses: ./.github/workflows/bvt-msvc.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-appleclang:
needs: prepare-release
name: Run BVT with AppleClang
uses: ./.github/workflows/bvt-appleclang.yml
with:
branch: release/${{ github.event.inputs.version }}

run-bvt-nvhpc:
needs: prepare-release
name: Run BVT with NVHPC
uses: ./.github/workflows/bvt-nvhpc.yml
with:
branch: release/${{ github.event.inputs.version }}

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:
runs-on: windows-latest
name: Draft release
runs-on: ubuntu-24.04
needs: report
steps:
- uses: actions/checkout@v3
with:
ref: release/${{ github.event.inputs.version }}
- uses: actions/checkout@v4

- name: create zip archive
run: Compress-Archive -Path ".\proxy.h" -DestinationPath ".\proxy-${{ github.event.inputs.version }}.zip"
- name: create tag
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 "release-bot@no.email.com"
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 }}
- uses: actions/create-release@v1
name: create release draft
id: release_draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Proxy ${{ github.event.inputs.version }} Release
draft: true
prerelease: true
- name: create tgz archive
run: tar -czf "proxy-${{ github.event.inputs.version }}.tgz" "proxy.h"

- name: upload artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: create release draft
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ steps.release_draft.outputs.upload_url }}
asset_path: ./proxy-${{ github.event.inputs.version }}.zip
asset_name: proxy-${{ github.event.inputs.version }}.zip
asset_content_type: application/zip
draft: true
files: proxy-${{ github.event.inputs.version }}.tgz
name: Proxy ${{ github.event.inputs.version }} Release
tag_name: ${{ github.event.inputs.version }}
generate_release_notes: true

0 comments on commit 68af9c8

Please sign in to comment.