|
1 | 1 | name: Update README |
2 | 2 |
|
| 3 | +# This workflow runs AFTER "Deploy Layers" completes successfully. |
| 4 | +# No version checking is needed here because: |
| 5 | +# 1. Deploy Layers already checks for new versions and skips if none exist |
| 6 | +# 2. Deploy Layers updates .tag_version before this workflow runs |
| 7 | +# 3. If this workflow is triggered, README should always be updated |
| 8 | + |
3 | 9 | on: |
4 | 10 | # push: |
5 | 11 | # branches: |
@@ -27,12 +33,10 @@ jobs: |
27 | 33 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
28 | 34 | aws-region: us-east-1 |
29 | 35 |
|
30 | | - - name: Check if update needed |
31 | | - id: check_update |
| 36 | + - name: Get Latest Release Info |
32 | 37 | run: | |
33 | 38 | JSON_RESPONSE=$(curl -s https://api.github.com/repos/Sparticuz/chromium/releases/latest) |
34 | 39 | TAG_VERSION=$(echo $JSON_RESPONSE | grep -Po '"tag_name": "\K[^"]+') |
35 | | - CURRENT_VERSION=$(cat .tag_version || echo '') |
36 | 40 |
|
37 | 41 | # Get layer file sizes for both architectures and convert to MB |
38 | 42 | X64_SIZE_BYTES=$(echo $JSON_RESPONSE | grep -Po '"name": "chromium-[^"]+-layer\.x64\.zip"[^}]*"size": \K[0-9]+' | head -1) |
|
52 | 56 | echo "ARM64_SIZE_MB=62" >> $GITHUB_ENV |
53 | 57 | fi |
54 | 58 |
|
55 | | - if [[ "$TAG_VERSION" == "$CURRENT_VERSION" ]]; then |
56 | | - echo "No new version to update. Current: $CURRENT_VERSION, Latest: $TAG_VERSION" |
57 | | - echo "skip=true" >> $GITHUB_OUTPUT |
58 | | - exit 0 |
59 | | - fi |
60 | | -
|
61 | | - echo "New version detected: $TAG_VERSION (current: $CURRENT_VERSION)" |
62 | | - echo "skip=false" >> $GITHUB_OUTPUT |
63 | 59 | echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV |
64 | 60 |
|
65 | | - - name: Get Latest Release URL and Tag Version |
66 | | - if: steps.check_update.outputs.skip == 'false' |
67 | | - run: | |
68 | | - echo "TAG_VERSION=${{ env.TAG_VERSION }}" >> $GITHUB_ENV |
69 | | -
|
70 | 61 | - name: Update README |
71 | | - if: steps.check_update.outputs.skip == 'false' |
72 | 62 | run: | |
73 | 63 | TAG_VERSION=${{ env.TAG_VERSION }} |
74 | 64 | X64_SIZE_MB=${{ env.X64_SIZE_MB }} |
|
91 | 81 | done |
92 | 82 |
|
93 | 83 | - name: Commit and Push |
94 | | - if: steps.check_update.outputs.skip == 'false' |
95 | 84 | run: | |
96 | 85 | git config --local user.email "action@github.com" |
97 | 86 | git config --local user.name "GitHub Action" |
|
0 commit comments