From e0f78ca74cbb68d663c5aa73ebef2f7ce16d157e Mon Sep 17 00:00:00 2001 From: Muhammad Nawaz Date: Sun, 16 Jun 2024 18:47:33 +0500 Subject: [PATCH] Updated workflow to upload artifacts --- .github/workflows/create-release.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d40ef38..19be3e4 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -18,27 +18,23 @@ jobs: - name: Create tar.gz archive run: | - mkdir -p release - git archive --format=tar.gz --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/ HEAD > release/cpp-oasvalidator-${GITHUB_REF#refs/tags/}.tar.gz + mkdir -p release/cpp-oasvalidator-${GITHUB_REF#refs/tags/} + git archive --format=tar.gz --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/ HEAD | tar -x -C release + git submodule foreach --recursive 'git archive --format=tar.gz --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/$path/ HEAD | tar -x -C release' cd release - tar -xzf cpp-oasvalidator-${GITHUB_REF#refs/tags/}.tar.gz - git submodule foreach --recursive 'git archive --format=tar.gz --prefix=$path/ HEAD > ../$path.tar.gz' - for f in *.tar.gz; do tar -xzf "$f"; done - rm *.tar.gz + tar -czf ../cpp-oasvalidator-${GITHUB_REF#refs/tags/}.tar.gz cpp-oasvalidator-${GITHUB_REF#refs/tags/} cd .. - tar -czf cpp-oasvalidator-${GITHUB_REF#refs/tags/}.tar.gz -C release . - name: Create zip archive run: | - mkdir -p release - git archive --format=zip --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/ HEAD > release/cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip + mkdir -p release/cpp-oasvalidator-${GITHUB_REF#refs/tags/} + git archive --format=zip --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/ HEAD -o release/cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip cd release - unzip cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip - git submodule foreach --recursive 'git archive --format=zip --prefix=$path/ HEAD > ../$path.zip' - for f in *.zip; do unzip "$f"; done - rm *.zip + unzip cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip -d . + rm cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip + git submodule foreach --recursive 'git archive --format=zip --prefix=cpp-oasvalidator-${GITHUB_REF#refs/tags/}/$path/ HEAD -o ../$path.zip && unzip ../$path.zip -d . && rm ../$path.zip' + zip -r ../cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip cpp-oasvalidator-${GITHUB_REF#refs/tags/} cd .. - zip -r cpp-oasvalidator-${GITHUB_REF#refs/tags/}.zip release - name: Upload Release Assets uses: actions/upload-artifact@v2