Skip to content

Commit 8e970f3

Browse files
committed
Use versioned spc-bin and latest spc-bin
1 parent 764894e commit 8e970f3

3 files changed

Lines changed: 27 additions & 15 deletions

File tree

.github/workflows/release-build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6161
6262
- name: "Cache Composer dependencies"
63-
uses: "actions/cache@v4"
63+
uses: "actions/cache@v5"
6464
with:
6565
path: "${{ steps.composer-cache.outputs.dir }}"
6666
key: "php-${{ env.PHP_VERSION }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
@@ -120,16 +120,28 @@ jobs:
120120
with:
121121
files: dist/${{ matrix.operating-system.filename }}
122122

123-
- name: "Deploy to self-hosted OSS"
124-
# only run this step if the repository is static-php-cli and the branch is main
125-
if: github.repository == 'crazywhalecc/static-php-cli' && github.ref == 'refs/heads/main'
123+
- name: "Deploy to self-hosted OSS (latest)"
124+
# only run this step if the repository is static-php-cli and is release tag
125+
if: ${{ github.repository == 'crazywhalecc/static-php-cli' && startsWith(github.ref, 'refs/tags/') }}
126126
uses: static-php/upload-s3-action@v1.0.0
127127
with:
128128
aws_key_id: ${{ secrets.AWS_KEY_ID }}
129129
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
130130
aws_bucket: ${{ secrets.AWS_BUCKET }}
131131
source_dir: "dist/"
132-
destination_dir: static-php-cli/spc-bin/nightly/
132+
destination_dir: v3/spc-bin/latest/
133+
endpoint: ${{ secrets.AWS_ENDPOINT }}
134+
135+
- name: "Deploy to self-hosted OSS (versioned)"
136+
# only run this step if the repository is static-php-cli and is release tag
137+
if: ${{ github.repository == 'crazywhalecc/static-php-cli' && startsWith(github.ref, 'refs/tags/') }}
138+
uses: static-php/upload-s3-action@v1.0.0
139+
with:
140+
aws_key_id: ${{ secrets.AWS_KEY_ID }}
141+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
142+
aws_bucket: ${{ secrets.AWS_BUCKET }}
143+
source_dir: "dist/"
144+
destination_dir: v3/spc-bin/${{ github.ref_name }}/
133145
endpoint: ${{ secrets.AWS_ENDPOINT }}
134146

135147
- name: "Upload Artifact"

README-zh.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535

3636
```bash
3737
# For Linux x86_64
38-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-linux-x86_64
38+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-linux-x86_64
3939
# For Linux aarch64
40-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-linux-aarch64
40+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-linux-aarch64
4141
# macOS x86_64 (Intel)
42-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-macos-x86_64
42+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-macos-x86_64
4343
# macOS aarch64 (Apple)
44-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-macos-aarch64
44+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-macos-aarch64
4545
# Windows (x86_64, win10 build 17063 or later, please install VS2022 first)
46-
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-release/latest/spc-windows-x64.exe
46+
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-bin/latest/spc-windows-x64.exe
4747
```
4848

4949
对于 macOS 和 Linux,请先添加可执行权限:

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535

3636
```bash
3737
# For Linux x86_64
38-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-linux-x86_64
38+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-linux-x86_64
3939
# For Linux aarch64
40-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-linux-aarch64
40+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-linux-aarch64
4141
# macOS x86_64 (Intel)
42-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-macos-x86_64
42+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-macos-x86_64
4343
# macOS aarch64 (Apple)
44-
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-release/latest/spc-macos-aarch64
44+
curl -fsSL -o spc https://dl.static-php.dev/v3/spc-bin/latest/spc-macos-aarch64
4545
# Windows (x86_64, win10 build 17063 or later, please install VS2022 first)
46-
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-release/latest/spc-windows-x64.exe
46+
curl.exe -fsSL -o spc.exe https://dl.static-php.dev/v3/spc-bin/latest/spc-windows-x64.exe
4747
```
4848

4949
For macOS and Linux, add execute permission first:

0 commit comments

Comments
 (0)