-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.43 KB
/
publish.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
name: Action Server manual Brew publish
on:
workflow_dispatch:
inputs:
version:
description: 'Version to upload'
required: true
default: 'x.x.x'
jobs:
action-server:
name: action-server
runs-on: macos-13
permissions:
contents: write # Ensuring the job has permission to write to the repository.
steps:
- name: main checkout
uses: actions/checkout@v4
- name: Update cask recipe
run: |
cd scripts
chmod +x ./homebrew-update.sh
./homebrew-update.sh ${{ github.event.inputs.version }}
- name: Install and Test Cask
run: |
brew install --cask Casks/action-server.rb
installed_version=$(action-server version)
echo "Installed Version: $installed_version"
if [ "$installed_version" != "${{ github.event.inputs.version }}" ]; then
echo "Version mismatch: expected ${{ github.event.inputs.version }}, got $installed_version"
exit 1
fi
- name: Commit and Push
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email 'actions@github.com'
git add Casks/action-server.rb
git commit -m "Update Action Server to version ${{ github.event.inputs.version }}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Using the GITHUB_TOKEN for authentication.