|
9 | 9 | sync: |
10 | 10 | runs-on: ubuntu-latest |
11 | 11 | steps: |
| 12 | + # Step 1: Checkout repo |
12 | 13 | - name: Checkout repo |
13 | 14 | uses: actions/checkout@v4 |
14 | 15 |
|
| 16 | + # Step 2: Get latest release tag from upstream |
15 | 17 | - name: Get latest release info |
16 | 18 | id: release |
17 | 19 | run: | |
18 | 20 | LATEST=$(curl -s https://api.github.com/repos/element-hq/element-web/releases/latest | jq -r '.tag_name') |
19 | 21 | echo "tag=$LATEST" >> $GITHUB_OUTPUT |
| 22 | + echo "Latest release: $LATEST" |
20 | 23 |
|
| 24 | + # Step 3: Download release |
21 | 25 | - name: Download release tarball |
22 | 26 | run: | |
23 | 27 | curl -L https://github.com/element-hq/element-web/archive/refs/tags/${{ steps.release.outputs.tag }}.tar.gz \ |
24 | 28 | -o element-web.tar.gz |
25 | 29 | tar -xzf element-web.tar.gz |
26 | 30 | mv element-web-* upstream-release |
27 | 31 |
|
28 | | - - name: Run custom script |
| 32 | + # Step 4: Run custom script, output to stable folder |
| 33 | + - name: Run rename/move script |
29 | 34 | run: | |
30 | 35 | chmod +x ./scripts/rename.sh |
| 36 | + # Use processed as stable folder |
31 | 37 | ./scripts/rename.sh ./upstream-release ./processed |
32 | 38 |
|
33 | | - - name: Commit and push changes |
| 39 | + # Step 5: Sync processed files into repo root safely |
| 40 | + - name: Sync processed files |
| 41 | + run: | |
| 42 | + rsync -a --delete --exclude='.github' --exclude='scripts' ./processed/ ./ |
| 43 | +
|
| 44 | + # Step 6: Commit and push changes |
| 45 | + - name: Commit and push |
34 | 46 | run: | |
35 | | - mkdir temp-sync |
36 | | - rsync -a --exclude='.github' --exclude='scripts' ./processed/ ./temp-sync/ |
37 | | - rsync -a --delete ./temp-sync/ ./ |
38 | | - rm -rf temp-sync |
39 | 47 | git config user.name "github-actions" |
40 | 48 | git config user.email "[email protected]" |
41 | 49 | git add . |
42 | 50 | git commit -m "Update to ${{ steps.release.outputs.tag }}" || echo "No changes to commit" |
43 | 51 | git push origin main |
44 | 52 |
|
45 | | - - name: Notify via issue |
| 53 | + # Step 7: Notify via issue |
| 54 | + - name: Notify via GitHub issue |
46 | 55 | uses: peter-evans/create-issue-from-file@v5 |
47 | 56 | with: |
48 | 57 | title: "New Element Web release ${{ steps.release.outputs.tag }}" |
49 | 58 | content-filepath: ./processed/CHANGELOG.md |
50 | 59 | token: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + |
0 commit comments