Archive download sources weekly #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Archive download sources weekly | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1 * * 5" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
download: | |
name: "Archive downloads to zip" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: [ "7.4", "8.0", "8.1", "8.2", "8.3" ] | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
repository: crazywhalecc/static-php-cli | |
- name: "Download SPC bin artifact for self-hosted runners" | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
repo: crazywhalecc/static-php-cli | |
branch: main | |
workflow: release-build.yml | |
name: "spc-linux-x86_64" | |
- name: "Validate SPC bin" | |
run: | | |
chmod +x spc | |
./spc --version | |
# If there's no dependencies cache, fetch sources, with or without debug | |
- name: "Download all sources" | |
run: | | |
./spc download --with-php=${{ matrix.php-version }} --all --debug | |
./spc doctor --auto-fix | |
# Upload downloaded files | |
- name: "Upload action artifacts" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: download-files-${{ matrix.php-version }} | |
path: downloads/ | |
- name: "Archive downloads as zip" | |
run: | | |
cd downloads/ | |
zip -r download-files-${{ matrix.php-version }}.zip . | |
mkdir ../downloads-archive/ | |
mv download-files-${{ matrix.php-version }}.zip ../downloads-archive/ | |
cd .. | |
- name: "Deploy to self-hosted OSS" | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws_bucket: ${{ secrets.AWS_BUCKET }} | |
source_dir: downloads-archive/ | |
destination_dir: static-php-cli/deps/downloads-archive/ | |
endpoint: ${{ secrets.AWS_ENDPOINT }} |