This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
153 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
To submit or update entries, please see [here](https://github.com/just-install/registry/blob/master/README.md). | ||
To submit or update packages, please see [here](https://github.com/just-install/registry/blob/master/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
clone_folder: C:\gopath\src\github.com\just-install\just-install | ||
shallow_clone: true | ||
test: off | ||
environment: | ||
GOPATH: C:\gopath | ||
PATH: C:\gopath\bin;%PROGRAMFILES(x86)%\WiX Toolset v3.11\bin;%PATH% | ||
PYTHONUNBUFFERED: 1 | ||
NETLIFY_DEPLOY_TOKEN: | ||
secure: JeAo8d6hrQCY73ADrmhWL0LL51VgjexXY2hX4ZxSReaPvUaV3cDOw5P+pAB3ZnIeLVKPcRshq7GwuOPBFRjqWKVnWXOvjFIkzp88Gvb6zEA= | ||
build_script: | ||
- cmd: go get -u github.com/kardianos/govendor | ||
- cmd: govendor sync | ||
- cmd: pip install requests==2.17.3 | ||
- cmd: .\script\cibuild.py | ||
artifacts: | ||
- path: just-install*.exe | ||
- path: just-install*.msi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
#!/usr/bin/env python | ||
# | ||
# just-install - The stupid package installer | ||
# | ||
# Copyright (C) 2013-2016 Lorenzo Villani | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
import glob | ||
import json | ||
import os | ||
import zipfile | ||
from subprocess import check_call | ||
|
||
import requests | ||
|
||
HERE = os.path.dirname(__file__) | ||
TOP_LEVEL = os.path.abspath(os.path.join(HERE, "..")) | ||
|
||
|
||
def main(): | ||
os.chdir(TOP_LEVEL) | ||
|
||
clean() | ||
build() | ||
build_msi() | ||
deploy() | ||
|
||
|
||
def clean(): | ||
def remove(*args): | ||
for arg in args: | ||
try: | ||
os.remove(arg) | ||
except: | ||
pass | ||
|
||
remove("just-install") | ||
remove(*glob.glob("*.exe")) | ||
remove(*glob.glob("*.msi")) | ||
remove(*glob.glob("*.wixobj")) | ||
remove(*glob.glob("*.wixpdb")) | ||
|
||
|
||
def build(): | ||
os.environ["GOARCH"] = "386" | ||
|
||
call( | ||
"go", "build", "-o", "just-install.exe", | ||
"-ldflags", "-X main.version={}".format(get_version()), "./bin") | ||
|
||
|
||
def build_msi(): | ||
if is_stable_build(): | ||
os.environ["JUST_INSTALL_MSI_VERSION"] = get_version() | ||
else: | ||
os.environ["JUST_INSTALL_MSI_VERSION"] = "255.0" # Fake MSI version for unstable builds | ||
|
||
call("candle", "just-install.wxs") | ||
call("light", "just-install.wixobj") | ||
|
||
|
||
def deploy(): | ||
target = "stable" if is_stable_build() else "unstable" | ||
|
||
print("Deploying to {}".format(target)) | ||
|
||
# Create zip archive for API-driven deployment | ||
with zipfile.ZipFile("deploy.zip", "w") as zipfileobj: | ||
zipfileobj.write("just-install.exe") | ||
zipfileobj.write("just-install.msi") | ||
zipfileobj.writestr("_redirects", "/ /just-install.msi") | ||
|
||
# Push zip archive to Netlify | ||
deploy_url = "https://api.netlify.com/api/v1/sites/just-install-{}.netlify.com/deploys".format( | ||
target) | ||
|
||
with open("deploy.zip", "rb") as fileobj: | ||
requests.post( | ||
deploy_url, | ||
data=fileobj, | ||
headers={ | ||
"Authorization": "Bearer {}".format(os.environ["NETLIFY_DEPLOY_TOKEN"]), | ||
"Content-Type": "application/zip", | ||
}, | ||
timeout=60) | ||
|
||
|
||
def call(*args): | ||
print("+", " ".join(args)) | ||
check_call(args) | ||
|
||
|
||
def get_version(): | ||
if is_stable_build(): | ||
with open(os.path.join(TOP_LEVEL, ".releng.json"), "r") as f: | ||
return json.load(f)["version"] | ||
else: | ||
return "unstable" | ||
|
||
|
||
def is_stable_build(): | ||
return "APPVEYOR_REPO_TAG_NAME" in os.environ | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |