From acdd22c692e397dde505c2942dacb87fa8e78705 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Fri, 2 Feb 2024 17:49:23 -0500 Subject: [PATCH 1/2] upload artifacts on each build --- .github/workflows/build-and-test-make.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 53c09b6e..9dba0d30 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -167,14 +167,19 @@ jobs: python_bin=$(which python3) sudo $python_bin -m pytest . --log-cli-level DEBUG --install-dir ${{ runner.temp }}/install --capture-interface ${{ matrix.capture_interface }} - # Upload pre-compiled binaries to GitHub releases page. + # Upload pre-compiled binaries to GitHub releases page and Github actions archives. - name: Create tar release files for libcurl-impersonate - if: startsWith(github.ref, 'refs/tags/') run: | cd ${{ runner.temp }}/install/lib tar -c -z -f ${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz libcurl-impersonate* echo "release_file_lib=${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz" >> $GITHUB_ENV + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + path: ${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + - name: Clean build if: startsWith(github.ref, 'refs/tags/') uses: addnab/docker-run-action@v3 @@ -220,12 +225,17 @@ jobs: make chrome-install-strip - name: Create tar release files for curl-impersonate - if: startsWith(github.ref, 'refs/tags/') run: | cd ${{ runner.temp }}/install/bin tar -c -z -f ${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz curl-impersonate-chrome curl_* echo "release_file_bin=${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz" >> $GITHUB_ENV + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + path: ${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + - name: Upload release files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') From 6b8f2e9f8bc9d54a7109ee0aaa6a6af20eb6ce38 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Fri, 2 Feb 2024 20:20:54 -0500 Subject: [PATCH 2/2] tweak archive names --- .github/workflows/build-and-test-make.yml | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test-make.yml b/.github/workflows/build-and-test-make.yml index 9dba0d30..20cc1e23 100644 --- a/.github/workflows/build-and-test-make.yml +++ b/.github/workflows/build-and-test-make.yml @@ -170,18 +170,21 @@ jobs: # Upload pre-compiled binaries to GitHub releases page and Github actions archives. - name: Create tar release files for libcurl-impersonate run: | - cd ${{ runner.temp }}/install/lib + cd ${{ runner.temp }}/install/lib + if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then tar -c -z -f ${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz libcurl-impersonate* - echo "release_file_lib=${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz" >> $GITHUB_ENV + else + tar -c -z -f ${{ runner.temp }}/libcurl-impersonate.${{ matrix.host }}.tar.gz libcurl-impersonate* + fi + echo "release_file_lib=${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz" >> $GITHUB_ENV - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz - path: ${{ runner.temp }}/libcurl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + name: libcurl-impersonate.${{ matrix.host }}.tar.gz + path: ${{ runner.temp }}/libcurl-impersonate*.tar.gz - name: Clean build - if: startsWith(github.ref, 'refs/tags/') uses: addnab/docker-run-action@v3 with: image: curl-impersonate-builder @@ -197,7 +200,6 @@ jobs: # Recompile curl-impersonate statically when doing a release. - name: Reconfigure statically - if: startsWith(github.ref, 'refs/tags/') && matrix.arch == 'x86_64' uses: addnab/docker-run-action@v3 with: image: curl-impersonate-builder @@ -210,7 +212,6 @@ jobs: ./configure --prefix=${{ runner.temp }}/install --enable-static - name: Rebuild statically - if: startsWith(github.ref, 'refs/tags/') uses: addnab/docker-run-action@v3 with: image: curl-impersonate-builder @@ -227,14 +228,18 @@ jobs: - name: Create tar release files for curl-impersonate run: | cd ${{ runner.temp }}/install/bin - tar -c -z -f ${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz curl-impersonate-chrome curl_* + if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then + tar -c -z -f ${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz curl-impersonate-chrome curl_* + else + tar -c -z -f ${{ runner.temp }}/curl-impersonate.${{ matrix.host }}.tar.gz curl-impersonate-chrome curl_* + fi echo "release_file_bin=${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz" >> $GITHUB_ENV - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz - path: ${{ runner.temp }}/curl-impersonate-${{ github.ref_name }}.${{ matrix.host }}.tar.gz + name: curl-impersonate.${{ matrix.host }}.tar.gz + path: ${{ runner.temp }}/curl-impersonate*.tar.gz - name: Upload release files uses: softprops/action-gh-release@v1