ci: avoid double zip; use tar instead to preserve x on linux/mac

This commit is contained in:
Simon Michael 2022-07-26 23:27:53 +01:00
parent 863983f0ff
commit 827d3f79f4
6 changed files with 38 additions and 28 deletions

View File

@ -41,10 +41,13 @@ jobs:
docker cp $container_id:/root/hledger tmp
docker rm -v $container_id
cd tmp
zip hledger-linux-static-arm32v7.zip hledger hledger-ui hledger-web
tar cvf hledger-linux-static-arm32v7.tar hledger hledger-ui hledger-web
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-linux-static-arm32v7
path: tmp/hledger-linux-static-arm32v7.zip
path: tmp/hledger-linux-static-arm32v7.tar

View File

@ -64,10 +64,13 @@ jobs:
strip hledger
strip hledger-ui
strip hledger-web
zip hledger-linux-x64.zip hledger hledger-ui hledger-web
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.zip
path: tmp/hledger-linux-x64.tar

View File

@ -169,14 +169,16 @@ jobs:
strip hledger
strip hledger-ui
strip hledger-web
zip hledger-mac-x64.zip hledger hledger-ui hledger-web
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web
if: env.CONTINUE
# XXX intermittent upload failures
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-mac-x64
path: tmp/hledger-mac-x64.zip
path: tmp/hledger-mac-x64.tar
if: env.CONTINUE

View File

@ -170,13 +170,13 @@ jobs:
cp /C/Users/runneradmin/AppData/Roaming/local/bin/hledger-web.exe .
strip hledger.exe
strip hledger-web.exe
zip hledger-windows-x64.zip hledger.exe hledger-web.exe
if: env.CONTINUE
# XXX intermittent upload failures
- name: Create binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-windows-x64
path: tmp/hledger-windows-x64.zip
path: |
tmp/hledger.exe
tmp/hledger-web.exe
if: env.CONTINUE

View File

@ -274,18 +274,20 @@ jobs:
strip hledger
strip hledger-ui
strip hledger-web
zip hledger-linux-x64.zip hledger hledger-ui hledger-web
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
if: env.CONTINUE
# how to set a context variable, and an attempt to make a nice artifact version suffix:
# echo "::set-output name=version::$(git branch --show-current | sed 's/-.*//')-$(git rev-parse --short HEAD)"
# XXX intermittent upload failures
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
# Unfortunately it means users must both unzip and untar.
- name: Upload binaries artifact
uses: actions/upload-artifact@v3
with:
name: hledger-linux-x64
path: tmp/hledger-linux-x64.zip
path: tmp/hledger-linux-x64.tar
if: env.CONTINUE

View File

@ -29,7 +29,7 @@ Or, if there are release binaries below suitable for your OS and hardware, you c
- YYYY-MM-DD: description. [#NNNN](https://github.com/simonmichael/hledger/issues/NNNN)
-->
Here are some instructions for the release binaries on various platforms:
Here are some instructions for the release binaries on various platforms. (You can copy & paste each block of commands as a unit, to save time.):
<details>
<summary>
@ -39,12 +39,12 @@ Here are some instructions for the release binaries on various platforms:
At the command line,
```
$ cd /usr/local/bin
$ curl -LOC- https://github.com/simonmichael/hledger/releases/download/A.BB/hledger-linux-x64.zip # can rerun this if interrupted
$ unzip -X hledger-linux-x64.zip
$ cd -
$ hledger --version # should show the new version
$ touch $HOME/.hledger.journal # ensure a default journal file exists
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/A.BB/hledger-linux-x64.zip # can rerun this if interrupted
unzip hledger-linux-x64.zip; tar xvf hledger-linux-x64.tar; rm hledger-linux-x64.{zip,tar} # github workaround, preserves permissions
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
```
</details>
@ -56,14 +56,14 @@ $ touch $HOME/.hledger.journal # ensure a default journal file exists
In a terminal window,
```
$ cd /usr/local/bin
$ curl -LOC- https://github.com/simonmichael/hledger/releases/download/A.BB/hledger-mac-x64.zip
$ unzip -X hledger-mac-x64.zip
$ open .
cd /usr/local/bin
curl -LOC- https://github.com/simonmichael/hledger/releases/download/A.BB/hledger-mac-x64.zip
unzip hledger-mac-x64.zip; tar xvf hledger-mac-x64.tar; rm hledger-mac-x64.{zip,tar} # github workaround, preserves permissions
open .
# for the hledger, hledger-ui, hledger-web icons: right-click the executable, Open, confirm it's ok to run
$ cd -
$ hledger --version # should show the new version
$ touch $HOME/.hledger.journal # ensure a default journal file exists
cd -
hledger --version # should show the new version
touch $HOME/.hledger.journal # ensure a default journal file exists
```
</details>
@ -75,7 +75,7 @@ $ touch $HOME/.hledger.journal # ensure a default journal file exists
In a powershell window (press Windows-r, type powershell, press enter),
Make a place to keep hledger binaries, and add it to your PATH. You only need to do this once, not for every release. This is optional, but makes running hledger easier.
Make a place to keep hledger binaries, and add it to your PATH; this makes running hledger easier. You only need to do this once, not for every release.
```
mkdir -force $HOME\bin >$null
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::User)+";"+$HOME+"\bin", [EnvironmentVariableTarget]::User)