From d8eddae65eca95bbfe16185b629f517a2cffe711 Mon Sep 17 00:00:00 2001 From: aeghn Date: Sun, 24 Nov 2024 22:18:28 +0800 Subject: [PATCH] ./ --- .github/workflows/restop.yml | 57 ++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/.github/workflows/restop.yml b/.github/workflows/restop.yml index a372b52..884d45b 100644 --- a/.github/workflows/restop.yml +++ b/.github/workflows/restop.yml @@ -1,11 +1,23 @@ -name: restop +name: Create release -on: [push] +on: + workflow_dispatch: + inputs: + sha: + description: "Commit SHA to create release from" + required: true + tag: + description: "Tag of the release" + required: true + push: + tags: + - 'v*' jobs: - x86_64-2010-build: + create-release: runs-on: ubuntu-latest - container: quay.io/pypa/manylinux2010_x86_64 + # Use a container with GLIBC 2.17 + container: quay.io/pypa/manylinux2014_x86_64 steps: - name: Show GLIBC run: ldd --version @@ -40,18 +52,33 @@ jobs: with: command: build args: --release - - name: Process and Package - if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - env: - SOURCE_TAG: ${{ steps.config.outputs.SOURCE_TAG }} - TARGET_NAME: ${{ steps.config.outputs.TARGET_NAME }} - run: echo SOURCE_TAG ${SOURCE_TAG} && echo TARGET_NAME ${TARGET_NAME} && ls -l src/target/ && cp src/target/${TARGET_NAME}/release/restop . && zip -j restop_${TARGET_NAME}_${SOURCE_TAG}.zip restop - - name: Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') + - name: Prepare archive + run: | + strip target/release/restop + export ARCHIVE_NAME=restop-${{ env.INPUT_TAG }}-linux-x64.tar.gz + echo "ARCHIVE_NAME=$ARCHIVE_NAME" >> $GITHUB_ENV + tar -czvf $ARCHIVE_NAME -C target/release restop + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - files: | - restop_${{ steps.config.outputs.TARGET_NAME }}_${{ steps.config.outputs.SOURCE_TAG }}.zip + tag_name: ${{ env.INPUT_TAG }} + release_name: ${{ env.INPUT_TAG }} + body: HQ ${{ env.INPUT_TAG }} + commitish: ${{ env.INPUT_SHA }} + draft: false + prerelease: false + + - name: Upload scheduler binary + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.ARCHIVE_NAME }} + asset_name: ${{ env.ARCHIVE_NAME }} + asset_content_type: application/tar+gzip \ No newline at end of file