File tree 3 files changed +57
-11
lines changed
3 files changed +57
-11
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ jobs:
119
119
done
120
120
package :
121
121
name : Update dist
122
- if : " !contains(github.event.head_commit.message, 'skip-release')"
122
+ if : " always() && !contains(github.event.head_commit.message, 'skip-release')"
123
123
needs : test
124
124
runs-on : ubuntu-latest
125
125
strategy :
@@ -129,9 +129,14 @@ jobs:
129
129
steps :
130
130
- name : Checkout
131
131
uses : actions/checkout@v2
132
+ - name : Add ZSTD
133
+ env :
134
+ REPO : ${{ github.repository }}
135
+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
136
+ USER : ${{ github.repository_owner }}
137
+ run : bash scripts/install-zstd.sh
132
138
- name : Package
133
139
run : |
134
- bash scripts/install-zstd.sh
135
140
mkdir builds
136
141
bash scripts/version-files.sh "$PHP_VERSION"
137
142
bash scripts/stage.sh "$PHP_VERSION"
@@ -149,7 +154,7 @@ jobs:
149
154
path : builds
150
155
release :
151
156
runs-on : ubuntu-latest
152
- if : " !contains(github.event.head_commit.message, 'skip-release')"
157
+ if : " always() && !contains(github.event.head_commit.message, 'skip-release')"
153
158
needs : package
154
159
steps :
155
160
- uses : actions/checkout@v2
Original file line number Diff line number Diff line change
1
+ name : Cache ZSTD
2
+ on :
3
+ - workflow_dispatch
4
+ jobs :
5
+ cache :
6
+ container : ubuntu:${{ matrix.container }}
7
+ runs-on : ubuntu-latest
8
+ strategy :
9
+ fail-fast : false
10
+ matrix :
11
+ container : [20.04, 18.04, 16.04]
12
+ if : " !contains(github.event.head_commit.message, 'skip-build')"
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v2
16
+ - name : Install requirements
17
+ run : apt-get update && apt-get install sudo curl make gcc jq unzip -y
18
+ - name : Get ZSTD_DIR
19
+ id : zstd
20
+ run : echo "::set-output name=ZSTD_DIR::$(curl -sL https://github.com/facebook/zstd/releases/latest | grep -Po "zstd-(\d+\.\d+\.\d+)" | head -n 1)"
21
+ - name : Add ZSTD
22
+ env :
23
+ REPO : ${{ github.repository }}
24
+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
25
+ USER : ${{ github.repository_owner }}
26
+ run : bash scripts/install-zstd.sh
27
+ - name : Upload zstd Artifact
28
+ uses : actions/upload-artifact@v2
29
+ with :
30
+ name : ${{ steps.zstd.outputs.zstd_dir }}-ubuntu${{ matrix.container }}
31
+ path : /opt/zstd
Original file line number Diff line number Diff line change 1
- if command -v brew > /dev/null; then
2
- export PATH=" $HOME /.linuxbrew/bin:$PATH "
3
- echo " export PATH=$HOME /.linuxbrew/bin:\$ PATH" >> " $GITHUB_ENV "
4
- brew install zstd > /dev/null 2>&1
1
+ sudo mkdir -p /opt/zstd
2
+ . /etc/os-release
3
+ zstd_dir=$( curl -sL https://github.com/facebook/zstd/releases/latest | grep -Po " zstd-(\d+\.\d+\.\d+)" | head -n 1)
4
+ zstd_url=$( curl -sL https://api.github.com/repos/" $REPO " /actions/artifacts | jq -r --arg zstd_dir " $zstd_dir -ubuntu$VERSION_ID " ' .artifacts[] | select(.name=="\($zstd_dir)").archive_download_url' 2> /dev/null | head -n 1)
5
+ if [ " x$zstd_url " = " x" ]; then
6
+ sudo apt-get install zlib1g liblzma-dev liblz4-dev -y
7
+ curl -o /tmp/zstd.tar.gz -sL https://github.com/facebook/zstd/releases/latest/download/" $zstd_dir " .tar.gz
8
+ tar -xzf /tmp/zstd.tar.gz -C /tmp
9
+ (
10
+ cd /tmp/" $zstd_dir " || exit 1
11
+ sudo make install -j" $( nproc) " PREFIX=/opt/zstd
12
+ )
5
13
else
6
- curl -sSLO http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-10/gcc-10-base_10-20200411-0ubuntu1_amd64.deb
7
- curl -sSLO http://archive.ubuntu.com/ubuntu/pool/main/g/gcc-10/libgcc-s1_10-20200411-0ubuntu1_amd64.deb
8
- curl -sSLO http://archive.ubuntu.com/ubuntu/pool/universe/libz/libzstd/zstd_1.4.4+dfsg-3_amd64.deb
9
- sudo DEBIAN_FRONTEND=noninteractive dpkg -i --force-conflicts ./ * .deb && rm -rf ./ * .deb
14
+ curl -u " $USER " : " $TOKEN " -o /tmp/zstd.zip -sL " $zstd_url "
15
+ ls /tmp
16
+ sudo unzip /tmp/zstd.zip -d /opt/zstd
17
+ sudo chmod -R a+x /opt/zstd/bin
10
18
fi
19
+ sudo ln -sf /opt/zstd/bin/* /usr/local/bin
20
+ rm -rf /tmp/zstd*
11
21
zstd -V
You can’t perform that action at this time.
0 commit comments