forked from shivammathur/php-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.72 KB
/
Copy pathzstd.yml
File metadata and controls
43 lines (43 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Cache ZSTD
on:
- workflow_dispatch
jobs:
cache:
container: ${{ matrix.container }}
runs-on: ${{ contains(matrix.container, 'arm') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
container: [ubuntu:26.04, ubuntu:24.04, ubuntu:22.04, arm64v8/ubuntu:22.04, arm64v8/ubuntu:24.04, arm64v8/ubuntu:26.04]
if: "!contains(github.event.head_commit.message, 'skip-build')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install requirements
run: apt-get update && apt-get install curl make gcc jq unzip -y
- name: Get ZSTD_DIR and CONTAINER_NAME
env:
CONTAINER: ${{ matrix.container }}
id: zstd
shell: bash
run: |
echo "ZSTD_DIR=zstd-$(curl -fsSL https://api.github.com/repos/facebook/zstd/releases/latest | jq -r '.tag_name | ltrimstr("v")')" | tee -a "$GITHUB_OUTPUT"
echo "CONTAINER_NAME=${CONTAINER//[\/:]/-}" | tee -a "$GITHUB_OUTPUT"
- name: Add ZSTD
env:
CONTAINER: ${{ matrix.container }}
REPO: ${{ github.repository }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
USER: ${{ github.repository_owner }}
ZSTD_DIR: ${{ steps.zstd.outputs.ZSTD_DIR }}
USE_CACHE: 'false'
run: bash scripts/install-zstd.sh
- name: Upload zstd Artifact
env:
ARTIFACT: ${{ steps.zstd.outputs.zstd_dir }}-${{ steps.zstd.outputs.container_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
apt-get install git gh -y
cd /opt/zstd
tar -czvf "$ARTIFACT.tar.gz" ./*
gh release upload "builds" -R "${{ github.repository }}" "$ARTIFACT.tar.gz" --clobber