Skip to content

Commit

Permalink
Restore tarball step as it really is needed
Browse files Browse the repository at this point in the history
GitHub Actions upload-artifact still strips executable bits, so we still
need the step of creating a .tar.gz file.
  • Loading branch information
rmunn committed Mar 27, 2024
1 parent b0138b0 commit 7b9b70f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 34 deletions.
53 changes: 25 additions & 28 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,44 +69,41 @@ jobs:
uid: ${{ steps.uid.outputs.uid }}
gid: ${{ steps.uid.outputs.gid }}

# Commented out for speed while we test upload@v4 file permissions
# - name: dotnet test
# run: |
# source environ
# dotnet test -l:"console;verbosity=normal" -l:nunit -c Release
# env:
# BUILD_NUMBER: ${{ github.run_number }}
# DbVersion: ${{ matrix.dbversion }}
# VSTEST_TESTHOST_SHUTDOWN_TIMEOUT: "30000"
# DebPackageVersion: ${{ steps.version.outputs.DebPackageVersion }}
# MsBuildVersion: ${{ steps.version.outputs.MsBuildVersion }}
# MajorMinorPatch: ${{ steps.version.outputs.MajorMinorPatch }}
# AssemblySemVer: ${{ steps.version.outputs.AssemblySemVer }}
# AssemblySemFileVer: ${{ steps.version.outputs.AssemblySemFileVer }}
# InformationalVersion: ${{ steps.version.outputs.InformationalVersion }}

# - name: Report test results
# uses: EnricoMi/publish-unit-test-result-action@v2.3.0
# if: always()
# with:
# nunit_files: "**/TestResults/TestResults.xml"
- name: dotnet test
run: |
source environ
dotnet test -l:"console;verbosity=normal" -l:nunit -c Release
env:
BUILD_NUMBER: ${{ github.run_number }}
DbVersion: ${{ matrix.dbversion }}
VSTEST_TESTHOST_SHUTDOWN_TIMEOUT: "30000"
DebPackageVersion: ${{ steps.version.outputs.DebPackageVersion }}
MsBuildVersion: ${{ steps.version.outputs.MsBuildVersion }}
MajorMinorPatch: ${{ steps.version.outputs.MajorMinorPatch }}
AssemblySemVer: ${{ steps.version.outputs.AssemblySemVer }}
AssemblySemFileVer: ${{ steps.version.outputs.AssemblySemFileVer }}
InformationalVersion: ${{ steps.version.outputs.InformationalVersion }}

- name: Report test results
uses: EnricoMi/publish-unit-test-result-action@v2.3.0
if: always()
with:
nunit_files: "**/TestResults/TestResults.xml"

- name: Prepare build output for installation tarball
run: docker/scripts/create-installation-tarball.sh ${DbVersion}
env:
DbVersion: ${{ matrix.dbversion }}

# TODO: Test if this is still needed with upload-artifact@v4. Does GitHub now create tarballs that preserve Unix file permissions? If so, we can eliminate this step.
# Commented out, and path changed to just "tarball", to see if Unix file permissions get preserved
# - name: Compress tarball images for faster uploads
# run: time (tar cf - tarball | gzip -c > tarball.tar.gz)
# actions/upload-artifact creates .zip files which do not preserve Unix file permissions, so we need to create a tarball
- name: Compress tarball images for faster uploads
run: time (tar cf - tarball | gzip -c > tarball.tar.gz)

- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: lfmerge-tarball-${{ matrix.dbversion }}
path: tarball
# path: tarball.tar.gz
compression-level: 0 # Already compressed in previous step. If we ever remove the previous step, we should remove this line also
path: tarball.tar.gz
compression-level: 0 # Already compressed in previous step
outputs:
MsBuildVersion: ${{ steps.output_version_number.outputs.VersionFor7000072 }}
TagFor7000072: ${{ steps.output_version_number.outputs.TagFor7000072 }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ jobs:
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
# No name specified, so will download all artifacts
path: tarball
merge-multiple: true
path: all-tarballs

- name: Verify that download step worked
run: ls -lR tarball
run: ls -lR all-tarballs

# Commented out to test whether upload@v4 preserves Unix file permissions correctly now
# - name: Uncompress build artifacts
# run: for f in all-tarballs/*/*.tar.gz; do gzip -cd "${f}" | tar xf -; done
- name: Uncompress build artifacts
run: for f in all-tarballs/*/*.tar.gz; do gzip -cd "${f}" | tar xf -; done

- name: Verify that uncompress step worked
run: ls -lR tarball
Expand Down

0 comments on commit 7b9b70f

Please sign in to comment.