-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2.42 KB
/
Copy pathrelease.yml
File metadata and controls
69 lines (60 loc) · 2.42 KB
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
#
# This FW update SHA and create a new PR in homebrew-TwoPi
#
name: Release
on:
release:
types:
- created
jobs:
update_formula_version:
name: Bump Homebrew formula
#runs-on: macos-latest
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: bump-formula-pr
# if: "!contains(github.ref, '-')" # skip prereleases (uncomment this later)
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.BREWRELEASETOKEN }}
run: |
echo ${{github.event.release.tag_name}}
SRC_URL="https://github.com/piScope/Test/archive/refs/tags/"${{ github.event.release.tag_name }}".tar.gz"
echo "${SRC_URL}"
#
# (this is for MacOS runner)
# printf "protocol=https\nhost=github.com\n" | git credential-osxkeychain erase
#
TAG_VERSION=$(echo ${{github.event.release.tag_name}} | sed 's/[^0-9.]*//g')
echo "TAG_VERSION=$(echo ${{github.event.release.tag_name}} | sed 's/[^0-9.]*//g')" >> $GITHUB_ENV
#
export HOMEBREW_GITHUB_API_TOKEN=${{ secrets.BREWRELEASETOKEN }}
brew tap piScope/twopi
cd $(brew --repo piScope/twopi)
echo "SRC_REPO=$(brew --repo piScope/twopi)" >> $GITHUB_ENV
echo "MESSAGE=bump-test-${TAG_VERSION}" >> $GITHUB_ENV
pwd
ls -l
#git remote -v
git config --global user.name 'sshiraiwa'
git config --global user.email 'shiraiwa@princeton.edu'
git remote -v
echo ${{ github.actor }}
brew bump-formula-pr -f -d -v --no-fork --write --no-browse --no-audit --url "${SRC_URL}" piscope/twopi/test
#git checkout --no-track -b bump-test-${TAG_VERSION} origin/master
git checkout --no-track -b bump-test-push origin/master
git add ./test.rb
#git commit --no-edit --verbose --message='test '${TAG_VERSION} -- ./test.rb
cat test.rb
cp -rf $(brew --repo piScope/twopi) ${{ github.workspace }}/homebrew-TwoPi
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.BREWRELEASETOKEN }}
commit-message: ${{ env.MESSAGE }}
path: 'homebrew-TwoPi'
branch: 'bump-test-push'
branch-suffix: 'timestamp'
base: 'master'