Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
12c34592
Commit
12c34592
authored
Sep 16, 2016
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'use-bump-formula-pr'
Fixes #980
parents
1b8bbf6a
073762c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
49 deletions
+9
-49
script/brew-publish
+7
-46
script/release
+2
-3
No files found.
script/brew-publish
View file @
12c34592
#!/bin/bash
#!/bin/bash
# Usage: script/brew-publish <name> <version> [<gh-project>]
# Usage: script/brew-publish <formula-name> <repo> <version>
#
set
-euo
pipefail
# Updates the `<name>.rb` Homebrew formula to `<version>` and sends a pull
# request with the change.
set
-e
brew_name
=
"
${
1
?
}
"
brew_name
=
"
${
1
?
}
"
version
=
"
${
2
?
}
"
repo
=
"
${
2
?
}
"
version
=
"
${
3
?
}
"
if
!
type
-p
hub
>
/dev/null
;
then
shift
3
"ERROR: You have to install hub to proceed."
>
&2
exit
1
fi
if
[
-n
"
$3
"
]
;
then
gh_project
=
"github.com/
${
3
}
"
else
gh_project
=
"
$(
git remote
-v
|
grep
'^origin'
|
grep
-oE
'github.com[:/][^/]+/[^/ ]+'
| head
-1
)
"
gh_project
=
"
${
gh_project
%.git
}
"
fi
url
=
"https://
${
gh_project
/
:/
\/
}
/archive/
${
version
}
.tar.gz"
url
=
"https://github.com/
${
repo
}
/archive/
${
version
}
.tar.gz"
checksum
=
"
$(
curl
-fsSL
"
$url
"
| shasum
-a
256
-b
| awk
'{print $1}'
)
"
checksum
=
"
$(
curl
-fsSL
"
$url
"
| shasum
-a
256
-b
| awk
'{print $1}'
)
"
if
[
-z
"
$checksum
"
]
;
then
brew bump-formula-pr
--url
=
"
$url
"
--sha256
=
"
$checksum
"
"
$brew_name
"
"
$@
"
echo
"ERROR: calculating the checksum failed for
$url
"
>
&2
exit
1
fi
pushd
"
$(
brew
--prefix
)
"
git fetch
-q
--unshallow
origin master 2>/dev/null
||
git fetch
-q
origin master
branch
=
"
${
brew_name
}
-
${
version
}
"
git checkout
-q
-B
"
$branch
"
origin/master
formula
=
"Library/Formula/
${
brew_name
}
.rb"
sed
-i
.bak
-E
"
s!^( url ).+!
\\
1
\"
${
url
}
\"
!
s!^( sha256 ).+!
\\
1
\"
${
checksum
}
\"
!
"
"
$formula
"
rm
-f
"
${
formula
}
.bak"
git commit
-m
"
${
brew_name
}
${
version
#v
}
"
--
"
$formula
"
# hackish way of getting the git remote name for user's fork
fork_remote
=
"
$(
hub fork 2>&1 |
grep
-oE
'remote:? \S+'
| tail
-1
| awk
'{print $2}'
)
"
git push
-u
"
$fork_remote
"
HEAD
hub pull-request
-m
"
${
brew_name
}
${
version
#v
}
"
git checkout
-q
-
script/release
View file @
12c34592
...
@@ -41,7 +41,6 @@ git push origin master "${version_tag}"
...
@@ -41,7 +41,6 @@ git push origin master "${version_tag}"
{
echo
"ruby-build
${
new_version
}
"
{
echo
"ruby-build
${
new_version
}
"
echo
echo
git log
--no-merges
--format
=
'%w(0,0,2)* %B'
--reverse
"
${
previous_tag
}
..HEAD^"
--
bin share
git log
--no-merges
--format
=
'%w(0,0,2)* %B'
--reverse
"
${
previous_tag
}
..HEAD^"
--
bin share
}
| hub release create
-dF
-
-c
"
$(
git rev-parse HEAD
)
"
"
$version_tag
"
||
true
}
| hub release create
-dF
-
"
$version_tag
"
||
true
hub browse
--
"releases/
${
version_tag
}
"
script/brew-publish ruby-build
"
$version_tag
"
script/brew-publish ruby-build
rbenv/ruby-build
"
$version_tag
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment