|
6 | 6 | workflow_dispatch:
|
7 | 7 |
|
8 | 8 | jobs:
|
| 9 | + preparation: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + actions: read |
| 15 | + |
| 16 | + outputs: |
| 17 | + status: ${{ steps.check.outputs.status }} |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: 📥 Checkout |
| 21 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 22 | + with: |
| 23 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 24 | + persist-credentials: false |
| 25 | + |
| 26 | + - name: 📦 Install dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: 🔍 Fetch release version |
| 30 | + run: | |
| 31 | + release_version=$(npm view material-icon-theme version) |
| 32 | + current_version=$(npm list material-icon-theme --depth=0 | grep 'material-icon-theme@' | cut -d '@' -f 2) |
| 33 | + echo "release_version=$release_version" >> $GITHUB_ENV |
| 34 | + echo "current_version=$current_version" >> $GITHUB_ENV |
| 35 | +
|
| 36 | + - name: ❌ Check release conditions |
| 37 | + id: check |
| 38 | + run: | |
| 39 | + status="skip" |
| 40 | + if [ "$release_version" != "$current_version" ] || [ "$GITHUB_EVENT_NAME" != "schedule" ]; then |
| 41 | + status="release" |
| 42 | + fi |
| 43 | + echo "status=$status" >> $GITHUB_OUTPUT |
| 44 | +
|
9 | 45 | release:
|
10 | 46 | runs-on: ubuntu-latest
|
| 47 | + needs: preparation |
| 48 | + if: needs.preparation.outputs.status == 'release' |
11 | 49 |
|
12 | 50 | permissions:
|
13 | 51 | contents: write
|
|
25 | 63 | - name: 📥 Checkout
|
26 | 64 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
27 | 65 | with:
|
28 |
| - # Required for fetching tags and generating release notes |
29 | 66 | fetch-depth: 0
|
30 | 67 | token: ${{ steps.app-token.outputs.token }}
|
| 68 | + persist-credentials: false |
31 | 69 |
|
32 | 70 | - name: 🔧 Configure Git
|
33 | 71 | run: |
|
|
38 | 76 | - name: 📦 Install dependencies
|
39 | 77 | run: npm ci
|
40 | 78 |
|
41 |
| - - name: 🔍 Fetch release version |
42 |
| - id: upstream |
43 |
| - run: | |
44 |
| - release_version=$(npm view material-icon-theme version) |
45 |
| - current_version=$(npm list material-icon-theme --depth=0 | grep 'material-icon-theme@' | cut -d '@' -f 2) |
46 |
| - echo "release_version=$release_version" >> $GITHUB_ENV |
47 |
| - echo "current_version=$current_version" >> $GITHUB_ENV |
48 |
| -
|
49 |
| - - name: ❌ Cancel if no new release is required |
50 |
| - if: ${{ env.release_version == env.current_version && github.event_name == 'schedule' }} |
51 |
| - run: echo "No new release required. Exiting..." && exit 0 |
52 |
| - |
53 | 79 | - name: 🔄 Attempt update
|
54 |
| - if: ${{ env.release_version != env.current_version }} |
55 | 80 | env:
|
56 | 81 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
57 |
| - # Update the material icon theme dependency to the latest major version (to avoid breaking changes) |
58 | 82 | run: |
|
59 | 83 | npm run update
|
60 | 84 |
|
|
0 commit comments