Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Deploy to Netlify
Browse files Browse the repository at this point in the history
  • Loading branch information
lvillani committed Jun 4, 2017
1 parent 664e745 commit 6f5d41d
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 113 deletions.
4 changes: 2 additions & 2 deletions .releng.json
Expand Up @@ -3,5 +3,5 @@
"comment": "Created by releng v0.0.6: https://github.com/lvillani/releng",
"version": 1
},
"version": "3.3.1"
}
"version": "3.4.0"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project are documented in this file.

## 3.4.0 - 2017-06-04

### Changed

* The most user-visible change should be that most stuff should be now served via TLS.




## 3.3.1 - 2017-02-09

Fixes to the CI system to produce 32-bit executables and installer packages.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
@@ -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).
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -6,7 +6,7 @@ _The simple package installer for Windows_

[![Build status](https://ci.appveyor.com/api/projects/status/wpof4badsg7y0l3s/branch/master?svg=true)](https://ci.appveyor.com/project/lvillani/just-install/branch/master)
[![License](http://img.shields.io/badge/license-GPL%203.0-blue.svg?style=flat)](http://choosealicense.com/licenses/gpl-3.0/)
[![Semver](http://img.shields.io/badge/version-v3.3.1-blue.svg?style=flat)](https://github.com/just-install/just-install/blob/master/CHANGELOG.md)
[![Semver](http://img.shields.io/badge/version-v3.4.0-blue.svg?style=flat)](https://github.com/just-install/just-install/blob/master/CHANGELOG.md)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/just-install/support)

--------------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions Vagrantfile
Expand Up @@ -6,9 +6,8 @@ VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "modernIE/w7-ie8"
config.vm.provision "shell", path: "bootstrap.cmd"
config.vm.provision "shell", path: "./script/bootstrap.cmd"
config.vm.synced_folder ".", "/gopath/src/github.com/just-install/just-install"
config.vm.synced_folder "~/.ssh", "/Users/vagrant/Desktop/ssh"

config.vm.provider "virtualbox" do |v|
v.gui = true
Expand Down
17 changes: 17 additions & 0 deletions appveyor.yml
@@ -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
105 changes: 0 additions & 105 deletions build.py

This file was deleted.

4 changes: 2 additions & 2 deletions just-install.wxs
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="just-install" Language="1033" Version="$(env.JustInstallVersion)" Manufacturer="Lorenzo Villani" UpgradeCode="6824DCF9-2C10-4C65-BF05-74A12E333931">
<Product Id="*" Name="just-install" Language="1033" Version="$(env.JUST_INSTALL_MSI_VERSION)" Manufacturer="Lorenzo Villani" UpgradeCode="6824DCF9-2C10-4C65-BF05-74A12E333931">
<Package Description="just-install" Comments="just-install" InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="data.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
Expand All @@ -15,4 +15,4 @@
<UI />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" />
</Product>
</Wix>
</Wix>
File renamed without changes.
120 changes: 120 additions & 0 deletions script/cibuild.py
@@ -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()

0 comments on commit 6f5d41d

Please sign in to comment.