forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (92 loc) · 3.4 KB
/
bump-unversioned-casks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Bump unversioned casks
on:
push:
paths:
- .github/workflows/bump-unversioned-casks.yml
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:
inputs:
clear_cache:
description: Clear cache
required: false
default: false
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
bump-unversioned-casks:
if: startsWith(github.repository, 'Homebrew/')
runs-on: macos-11.0
steps:
- name: Check if another run already exists
id: skip
uses: fkirc/skip-duplicate-actions@4c656bbdb6906310fa6213604828008bc28fe55d
with:
cancel_others: false
concurrent_skipping: always
- name: Cancel this build
uses: andymckay/cancel-action@8f8510d9dea52fcc8eb6ca10d6ce47fd5fc43cd8
if: fromJSON(steps.skip.outputs.should_skip)
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
test-bot: false
- name: Configure Git user
uses: Homebrew/actions/git-user-config@master
with:
username: BrewTestBot
- name: Set up commit signing
id: set-up-commit-signing
uses: Homebrew/actions/setup-commit-signing@master
with:
signing_key: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY }}
# Workaround until the `cache` action uses the changes from
# https://github.com/actions/toolkit/pull/580.
- name: Unlink workspace
run: |
mv "${GITHUB_WORKSPACE}" "${GITHUB_WORKSPACE}-link"
mkdir "${GITHUB_WORKSPACE}"
- name: Cache Homebrew Gems
uses: actions/[email protected]
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Gems
run: brew install-bundler-gems
- name: Generate cache ID
id: cache-id
run: |
echo "::set-output name=time::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
- name: Cache state
uses: actions/[email protected]
with:
path: ~/bump-unversioned-casks-state.json
key: bump-unversioned-casks-${{ steps.cache-id.outputs.time }}
restore-keys: bump-unversioned-casks-
- name: Clear cache
if: github.event.inputs.clear_cache == 'true'
run: |
rm -f ~/bump-unversioned-casks-state.json
# Workaround until the `cache` action uses the changes from
# https://github.com/actions/toolkit/pull/580.
- name: Re-link workspace
run: |
rmdir "${GITHUB_WORKSPACE}"
mv "${GITHUB_WORKSPACE}-link" "${GITHUB_WORKSPACE}"
- name: Run brew bump-unversioned-casks ${{ github.repository }}
run: |
brew bump-unversioned-casks --state-file ~/bump-unversioned-casks-state.json --limit 15 '${{ github.repository }}'
env:
HOMEBREW_DEBUG: 1
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.HOMEBREW_GITHUB_PUBLIC_REPO_TOKEN }}
HOMEBREW_GPG_PASSPHRASE: ${{ secrets.BREWTESTBOT_GPG_SIGNING_SUBKEY_PASSPHRASE }}
timeout-minutes: 20
# Workaround until the `cache` action uses the changes from
# https://github.com/actions/toolkit/pull/580.
- name: Unlink workspace
run: |
rm "${GITHUB_WORKSPACE}"
mkdir "${GITHUB_WORKSPACE}"