<commit_before># appveyor recipe to create msi package

This is an HOWDOI build an msi package from a non windows machine using appveyor cloud service.


### Requirements

- a github account
- a github repo
- an appveyor account


### Repo setup

1. Add your repo to appveyor config
2. Generate a new Github API token (Settings->Personal access tokens->Generate new token). Give it authorizations to `repo`.
3. Save the new token!
3. Add a new `appveyor.yml` to the root of your repo
4. Encrypt the token value as an appveyor secure variable (AppVeyor->Dashboard->[Encrypt Data](https://ci.appveyor.com/tools/encrypt))
5. Modify below appveyor template

__appveyor.yml__

```yml
version: "{build}"

os: Windows Server 2012 R2

clone_folder: c:\gopath\src\github.com\mh-cbon\go-msi             # Change this

skip_non_tags: true

environment:
  GOPATH: c:\gopath
  GO15VENDOREXPERIMENT: 1

install:
  - curl -fsSv -o C:\wix310-binaries.zip http://static.wixtoolset.org/releases/v3.10.3.3007/wix310-binaries.zip
  - dir C:\
  - 7z x C:\wix310-binaries.zip -y -r -oC:\wix310
  - set PATH=C:\wix310;%PATH%
  - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
  - go version
  - go env
  - go get -u github.com/Masterminds/glide
  - curl -fsSv -o C:\go-msi.msi https://github.com/mh-cbon/go-msi/releases/download/0.0.15/go-msi-0.0.15-x64.msi
  - msiexec.exe /i C:\go-msi.msi /quiet

build_script:
  - glide install
  - GOARCh=386 go build -o go-msi.exe main.go             # Change this
  - go-msi.exe make --msi %APPVEYOR_BUILD_FOLDER%\go-msi-%APPVEYOR_REPO_TAG_NAME%-x86.msi --version %APPVEYOR_REPO_TAG_NAME% --arch x86             # Change this
  - GOARCh=amd64 go build -o go-msi.exe main.go             # Change this
  - go-msi.exe make --msi %APPVEYOR_BUILD_FOLDER%\go-msi-%APPVEYOR_REPO_TAG_NAME%-x64.msi --version %APPVEYOR_REPO_TAG_NAME% --arch x64             # Change this

# to disable automatic tests
test: off

# ?
artifacts:
  - path: '*-x86.msi'
    name: msi-x86
  - path: '*-x64.msi'
    name: msi-x64

# to disable deployment
deploy:
  - provider: GitHub
    artifact: msi-x86, msi-x64
    draft: false
    prerelease: false
    desription: "Release {APPVEYOR_REPO_TAG_NAME}"
    auth_token:
      secure: xxxxx                                         # Change this to your encrypted token value
    on:<commit_msg>go fmt<commit_after># appveyor recipe to create msi package

This is an HOWDOI build an msi package from a non windows machine using appveyor cloud service.


### Requirements

- a github account
- a github repo
- an appveyor account


### Repo setup

1. Add your repo to appveyor config
2. Generate a new Github API token (Settings->Personal access tokens->Generate new token). Give it authorizations to `repo`.
3. Save the new token!
3. Add a new `appveyor.yml` to the root of your repo
4. Encrypt the token value as an appveyor secure variable (AppVeyor->Dashboard->[Encrypt Data](https://ci.appveyor.com/tools/encrypt))
5. Modify below appveyor template

__appveyor.yml__

```yml
version: "{build}"

os: Windows Server 2012 R2

clone_folder: c:\gopath\src\github.com\mh-cbon\go-msi             # Change this

skip_non_tags: true

environment:
  GOPATH: c:\gopath
  GO15VENDOREXPERIMENT: 1

install:
  - curl -fsSv -o C:\wix310-binaries.zip http://static.wixtoolset.org/releases/v3.10.3.3007/wix310-binaries.zip
  - dir C:\
  - 7z x C:\wix310-binaries.zip -y -r -oC:\wix310
  - set PATH=C:\wix310;%PATH%
  - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
  - go version
  - go env
  - go get -u github.com/Masterminds/glide
  - curl -fsSv -o C:\go-msi.msi https://github.com/mh-cbon/go-msi/releases/download/0.0.15/go-msi-0.0.15-x64.msi
  - msiexec.exe /i C:\go-msi.msi /quiet

build_script:
  - glide install
  - set GOARCH=386
  - go build -o go-msi.exe main.go             # Change this
  - go-msi.exe make --msi %APPVEYOR_BUILD_FOLDER%\go-msi-%APPVEYOR_REPO_TAG_NAME%-x86.msi --version %APPVEYOR_REPO_TAG_NAME% --arch x86             # Change this
  - echo %GOARCH%
  - set GOARCH=amd64
  - go build -o go-msi.exe main.go             # Change this
  - go-msi.exe make --msi %APPVEYOR_BUILD_FOLDER%\go-msi-%APPVEYOR_REPO_TAG_NAME%-x64.msi --version %APPVEYOR_REPO_TAG_NAME% --arch x64             # Change this
  - echo %GOARCH%

# to disable automatic tests
test: off

# ?
artifacts:
  - path: '*-x86.msi'
    name: msi-x86
  - path: '*-x64.msi'
    name: msi-x64

# to disable deployment
deploy:
  - provider: GitHub
    artifact: msi-x86, msi-x64
    draft: false
    prerelease: false
    desription: "Release {APPVEYOR_REPO_TAG_NAME}"
    auth_token:
      secure: xxxxx                                         # Change this to your encrypted token value
    on:
{'fraction_non_alphanumeric': 0.11824973319103523, 'fraction_numerical': 0.031163287086446105, 'mean_word_length': 2.7488, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4580908', 'n_tokens_mistral': 1916, 'n_tokens_neox': 1787, 'n_words': 464}