Skip to content

Commit

Permalink
More appveyor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kglovern committed May 13, 2021
1 parent e9591fb commit 510a2d7
Showing 1 changed file with 101 additions and 102 deletions.
203 changes: 101 additions & 102 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ environment:
- job_name: Linux build (arm)
appveyor_build_worker_image: Ubuntu2004
nodejs_version: "12"
ARCH: arm
- job_name: Windows build (x64)
appveyor_build_worker_image: Visual Studio 2019
nodejs_version: "12"
Expand All @@ -22,17 +23,17 @@ environment:
appveyor_build_worker_image: Ubuntu2004
nodejs_version: "12"
ARCH: arm64
- job_name: Windows build (x86)
appveyor_build_worker_image: Visual Studio 2019
nodejs_version: "12"
ARCH: x86
- job_name: macOS build (x64)
appveyor_build_worker_image: macos
nodejs_version: "12"
ARCH: x64
- job_name: Windows build (x86)
appveyor_build_worker_image: Visual Studio 2019
nodejs_version: "12"
ARCH: x86
global:
GH_TOKEN:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
GITHUB_TOKEN:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/

Expand All @@ -41,8 +42,8 @@ for:
-
matrix:
only:
- job_name: Linux build (arm)
- job_name: Linux build (amd64)
- job_name: Linux build (arm)
- job_name: Linux build (arm64)
fast_finish: true

Expand Down Expand Up @@ -303,6 +304,100 @@ for:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "12"

# macOS
-
matrix:
only:
- job_name: macOS build (x64)
fast_finish: true

init:
- uname -a
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "appveyor@ci.appveyor.com"
- sh: |
export CI_BRANCH=$APPVEYOR_REPO_BRANCH
export CI_BUILD_NUMBER=$APPVEYOR_BUILD_NUMBER
export CI_COMMIT=$APPVEYOR_REPO_COMMIT
export CI_COMMIT_SHORT=${APPVEYOR_REPO_COMMIT:0:8}
export CI_COMMIT_TIMESTAMP=$APPVEYOR_REPO_COMMIT_TIMESTAMP
export CI_TAG=$APPVEYOR_REPO_TAG_NAME
echo "• ARCH=$ARCH"
echo "• CI_BRANCH=$CI_BRANCH"
echo "• CI_BUILD_NUMBER=$CI_BUILD_NUMBER"
echo "• CI_COMMIT=$CI_COMMIT"
echo "• CI_COMMIT_SHORT=$CI_COMMIT_SHORT"
echo "• CI_COMMIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP"
echo "• CI_TAG=$CI_TAG"
install:
- nvm install $nodejs_version
- security import "scripts/certs/Certum-Code-Signing-CA-SHA2.cer" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign
- npm config set loglevel warn
- npm config set scripts-prepend-node-path auto
- npm install -g npm
- npm install -g yarn
- yarn

build_script:
- sh: |
yarn clean
yarn lint
yarn test
if [[ -z "$CI_TAG" ]]; then
yarn build-latest
else
yarn build
fi
- sh: |
# x64
if [[ "$ARCH" == "x64" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:macos-x64
ls -al output output/*
mkdir -p releases/macos
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg"
ls -al releases/macos/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-macos.x64.dmg";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
#rm -f "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
fi
fi
test: off

# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
- path: releases/macos/*

# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "12"

# Windows
-
matrix:
Expand Down Expand Up @@ -422,99 +517,3 @@ for:
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "12"



# macOS
-
matrix:
only:
- job_name: macOS build (x64)
fast_finish: true

init:
- uname -a
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "appveyor@ci.appveyor.com"
- sh: |
export CI_BRANCH=$APPVEYOR_REPO_BRANCH
export CI_BUILD_NUMBER=$APPVEYOR_BUILD_NUMBER
export CI_COMMIT=$APPVEYOR_REPO_COMMIT
export CI_COMMIT_SHORT=${APPVEYOR_REPO_COMMIT:0:8}
export CI_COMMIT_TIMESTAMP=$APPVEYOR_REPO_COMMIT_TIMESTAMP
export CI_TAG=$APPVEYOR_REPO_TAG_NAME
echo "• ARCH=$ARCH"
echo "• CI_BRANCH=$CI_BRANCH"
echo "• CI_BUILD_NUMBER=$CI_BUILD_NUMBER"
echo "• CI_COMMIT=$CI_COMMIT"
echo "• CI_COMMIT_SHORT=$CI_COMMIT_SHORT"
echo "• CI_COMMIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP"
echo "• CI_TAG=$CI_TAG"
install:
- nvm install $nodejs_version
- security import "scripts/certs/Certum-Code-Signing-CA-SHA2.cer" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign
- npm config set loglevel warn
- npm config set scripts-prepend-node-path auto
- npm install -g npm
- npm install -g yarn
- yarn

build_script:
- sh: |
yarn clean
yarn lint
yarn test
if [[ -z "$CI_TAG" ]]; then
yarn build-latest
else
yarn build
fi
- sh: |
# x64
if [[ "$ARCH" == "x64" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:macos-x64
ls -al output output/*
mkdir -p releases/macos
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg"
ls -al releases/macos/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-macos.x64.dmg";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
#rm -f "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
fi
fi
test: off

# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
- path: releases/macos/*

# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "12"

0 comments on commit 510a2d7

Please sign in to comment.