|
60 | 60 | echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
61 | 61 |
|
62 | 62 | - name: "Cache Composer dependencies" |
63 | | - uses: "actions/cache@v4" |
| 63 | + uses: "actions/cache@v5" |
64 | 64 | with: |
65 | 65 | path: "${{ steps.composer-cache.outputs.dir }}" |
66 | 66 | key: "php-${{ env.PHP_VERSION }}-locked-composer-${{ hashFiles('**/composer.lock') }}" |
@@ -120,16 +120,28 @@ jobs: |
120 | 120 | with: |
121 | 121 | files: dist/${{ matrix.operating-system.filename }} |
122 | 122 |
|
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/') }} |
126 | 126 | uses: static-php/upload-s3-action@v1.0.0 |
127 | 127 | with: |
128 | 128 | aws_key_id: ${{ secrets.AWS_KEY_ID }} |
129 | 129 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
130 | 130 | aws_bucket: ${{ secrets.AWS_BUCKET }} |
131 | 131 | 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 }}/ |
133 | 145 | endpoint: ${{ secrets.AWS_ENDPOINT }} |
134 | 146 |
|
135 | 147 | - name: "Upload Artifact" |
|
0 commit comments