From a975177d1d127007176d67f34e70a13968f5b02c Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Fri, 18 Sep 2020 15:34:07 -0700 Subject: [PATCH] (experiment) re-enable everything(?) and remove Mac stuff from Travis --- .github/workflows/macos.yml | 17 +++++++++++++++++ .travis.yml | 9 ++------- getpwd.js | 4 ---- sign_mac_app.sh | 38 ++++++++++++++++++------------------- update_version.sh | 2 +- 5 files changed, 39 insertions(+), 31 deletions(-) delete mode 100644 getpwd.js diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8690901..ce4eb58 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -36,11 +36,21 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./build.sh + - name: Sign binary + run: ./sign_mac_app.sh + env: + CERTIFICATE_OSX_P12: ${{ secrets.CERTIFICATE_OSX_P12 }} + CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} + CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }} + - name: Zip release run: ./create_zip.sh - name: DMG the release run: ./create_dmg.sh + + - name: Generate shasums + run: ./sum.sh - name: Release uses: softprops/action-gh-release@v1 @@ -54,3 +64,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update versions repo + if: env.SHOULD_BUILD == 'yes' + run: ./update_version.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} + diff --git a/.travis.yml b/.travis.yml index 7008fe0..5dc96e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ language: node_js node_js: "12.14.1" install: - - node getpwd.js - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" - . install_deps.sh @@ -25,9 +24,6 @@ script: - ./build.sh before_deploy: - - ./sign_mac_app.sh - - ./create_zip.sh - - ./create_dmg.sh - ./sum.sh deploy: @@ -41,7 +37,6 @@ deploy: - ./*.sha256 - ./*.zip - ./*.tar.gz - - ./*.dmg - ./*.deb - ./*.rpm - ./*.AppImage @@ -50,5 +45,5 @@ deploy: all_branches: true condition: $SHOULD_BUILD = yes - #after_deploy: - #- ./update_version.sh +after_deploy: + - ./update_version.sh diff --git a/getpwd.js b/getpwd.js deleted file mode 100644 index baa4916..0000000 --- a/getpwd.js +++ /dev/null @@ -1,4 +0,0 @@ -const pwd = process.env.CERTIFICATE_OSX_PASSWORD - -console.log(pwd.slice(0, Math.floor(pwd.length / 2))) -console.log(pwd.slice(Math.floor(pwd.length / 2))) diff --git a/sign_mac_app.sh b/sign_mac_app.sh index 11669b9..1f3032a 100755 --- a/sign_mac_app.sh +++ b/sign_mac_app.sh @@ -2,22 +2,22 @@ # thanks to https://www.jviotti.com/2016/03/16/how-to-code-sign-os-x-electron-apps-in-travis-ci.html # for the helpful instructions -# if [[ "$SHOULD_BUILD" == "yes" ]]; then -# if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then -# if [ -d "VSCode-darwin" ]; then # just in case the build failed -# cd VSCode-darwin -# export CERTIFICATE_P12=VSCodium.p12 -# echo $CERTIFICATE_OSX_P12 | base64 --decode > $CERTIFICATE_P12 -# export KEYCHAIN=build.keychain -# security create-keychain -p mysecretpassword $KEYCHAIN -# security default-keychain -s $KEYCHAIN -# security unlock-keychain -p mysecretpassword $KEYCHAIN -# security import $CERTIFICATE_P12 -k $KEYCHAIN -P $CERTIFICATE_OSX_PASSWORD -T /usr/bin/codesign -# -# # https://docs.travis-ci.com/user/common-build-problems/ -# security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword $KEYCHAIN -# -# codesign --deep --force --verbose --sign "$CERTIFICATE_OSX_ID" VSCodium.app -# fi -# fi -# fi +if [[ "$SHOULD_BUILD" == "yes" ]]; then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + if [ -d "VSCode-darwin" ]; then # just in case the build failed + cd VSCode-darwin + export CERTIFICATE_P12=VSCodium.p12 + echo $CERTIFICATE_OSX_P12 | base64 --decode > $CERTIFICATE_P12 + export KEYCHAIN=build.keychain + security create-keychain -p mysecretpassword $KEYCHAIN + security default-keychain -s $KEYCHAIN + security unlock-keychain -p mysecretpassword $KEYCHAIN + security import $CERTIFICATE_P12 -k $KEYCHAIN -P $CERTIFICATE_OSX_PASSWORD -T /usr/bin/codesign + + # https://docs.travis-ci.com/user/common-build-problems/ + security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword $KEYCHAIN + + codesign --deep --force --verbose --sign "$CERTIFICATE_OSX_ID" VSCodium.app + fi + fi +fi diff --git a/update_version.sh b/update_version.sh index 4610ecf..ff0aef5 100755 --- a/update_version.sh +++ b/update_version.sh @@ -34,7 +34,7 @@ if [[ "$CI_WINDOWS" == "True" ]]; then git config --global core.autocrlf true else # TRAVIS_REPO_SLUG = e.g. VSCodium/vscodium - VERSIONS_REPO=$(echo ${TRAVIS_REPO_SLUG} | awk -F"/" '{ print $1 }')/versions + VERSIONS_REPO=$(echo ${TRAVIS_REPO_SLUG:-${GITHUB_REPOSITORY}} | awk -F"/" '{ print $1 }')/versions fi # generateJson