2020-12-07 13:35:22 -06:00
name : Release
on :
push :
2021-06-17 07:20:07 -05:00
branches : [ master, main]
2020-12-07 13:35:22 -06:00
tags : [ "*" ]
2021-07-08 08:10:34 -05:00
release :
types : [ published ]
2021-05-19 16:38:32 -05:00
env :
pkg-assembly : 'bitcoin-s-bundle.jar'
pkg-name : 'bitcoin-s'
2020-12-07 13:35:22 -06:00
jobs :
publish :
runs-on : ubuntu-latest
2021-04-18 09:02:49 -05:00
timeout-minutes : 60
2020-12-07 13:35:22 -06:00
steps :
- uses : actions/checkout@v2.3.4
with :
2021-02-22 09:08:52 -06:00
fetch-depth : 0
2022-02-21 15:52:24 -06:00
- uses : olafurpg/setup-scala@v13
2021-04-28 16:21:09 -05:00
with :
2022-02-21 10:52:55 -06:00
java-version : openjdk@1.17.0
2020-12-07 13:35:22 -06:00
- uses : olafurpg/setup-gpg@v3
2022-02-22 09:27:13 -06:00
- run : sbt -J-Xmx2g ci-release docs/publishWebsite
2020-12-07 13:35:22 -06:00
env :
PGP_PASSPHRASE : ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET : ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
GITHUB_DEPLOY_KEY : ${{ secrets.GITHUB_TOKEN }}
GIT_DEPLOY_KEY : ${{ secrets.GIT_DEPLOY_KEY }}
2021-05-19 16:38:32 -05:00
osx :
runs-on : [ macos-latest ]
steps :
- name : Checkout repo
uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
2022-02-21 15:52:24 -06:00
uses : olafurpg/setup-scala@v13
2021-05-19 16:38:32 -05:00
with :
2022-02-21 10:52:55 -06:00
java-version : openjdk@1.17.0
2021-05-19 16:38:32 -05:00
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 0.0 .0 # Optional fallback tag to use when no tag can be found
- name : Import developer cert to keychain
uses : apple-actions/import-codesign-certs@v1
with :
create-keychain : true
p12-file-base64 : ${{ secrets.CERTIFICATES_P12 }}
p12-password : ${{ secrets.CERTIFICATES_P12_PASSWORD }}
keychain-password : ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name : Build fat jar
run : sbt "bundle/assembly"
- name : Add cert to keychain and unlock keychain & build and sign dmg
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
MACOS_CERTIFICATE_PWD : ${{ secrets.CERTIFICATES_P12_PASSWORD }}
MAC_NOTARIZATION_PW : ${{secrets.MAC_NOTARIZATION_PW}}
2021-06-17 07:20:07 -05:00
# Steps to build a fully signed and notarized bitcoin-s dmg
2021-05-19 16:38:32 -05:00
# 1. Unlock the OS x keychain so we don't have to input passwords via GUI prompts
2021-06-17 07:20:07 -05:00
# 2. Build bitcoin-s.app that is recursively signed with jpackage --mac-sign
# 3. Build an unsigned dmg that contains bitcoin-s.app inside of it (no idea why --mac-sign doesn't work with --type dmg)
2021-05-19 16:38:32 -05:00
# 4. Sign the dmg with codesign (jpackage dmg signing is broken for some reason)
# 5. Submit the dmg to apple's notarization service so can get it whitelisted for installation (see: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution)
# 6. Sleep until apple notorization is done
# 7. Retrieve the signature and staple it to the dmg to so network requests do not need to be made to open the dmg
2021-06-17 07:20:07 -05:00
# 8. Check all signatures on bitcoin-s.app (see: https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087735)
2021-05-19 16:38:32 -05:00
# 9. Check all dmg signatures
# 10. Display information about signed dmg
run : |
echo "Hello world"
java -version
jpackage --version
ls -l
security unlock-keychain -p $MACOS_CERTIFICATE_PWD signing_temp.keychain
security set-key-partition-list -S apple-tool:,apple:,codesign : -s -k $MACOS_CERTIFICATE_PWD signing_temp.keychain
echo "===========jpackage app image begin================"
2021-05-26 18:09:53 -05:00
jpackage --verbose --name ${{ env.pkg-name }} --app-version ${{steps.previoustag.outputs.tag}} --mac-package-name ${{ env.pkg-name }} --type app-image -i app/bundle/target/scala-2.13/ --main-class org.bitcoins.bundle.gui.BundleGUI --main-jar ${{ env.pkg-assembly }} --icon app/gui/src/main/resources/icons/bitcoin-s.icns --mac-sign --mac-signing-keychain /Users/runner/Library/Keychains/signing_temp.keychain-db --mac-signing-key-user-name "Chris Stewart (9ZG3GPKHX8)"
2021-05-19 16:38:32 -05:00
echo "===========jpackage dmg begin================"
jpackage --verbose --name ${{ env.pkg-name }} --app-version ${{steps.previoustag.outputs.tag}} --mac-package-name ${{ env.pkg-name }} --type dmg --app-image bitcoin-s.app --mac-sign --mac-signing-key-user-name "Chris Stewart (9ZG3GPKHX8)"
echo "Signing dmg with code sign"
codesign -s "Developer ID Application: Chris Stewart (9ZG3GPKHX8)" --options runtime -vvvv --deep ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
2021-06-15 10:06:03 -05:00
echo "Running xcrun alttool --notarize app"
REQUEST_UUID=$(xcrun altool --notarize-app --primary-bundle-id "org.bitcoins.bundle" -u "stewart.chris1234@gmail.com" --team-id "9ZG3GPKHX8" --password "$MAC_NOTARIZATION_PW" --file ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg | grep RequestUUID | awk '{print $3}')
2021-05-19 16:38:32 -05:00
echo "Waiting for notarization from Apple for $REQUEST_UUID"
sleep 5
2021-06-15 10:06:03 -05:00
xcrun altool --notarization-info "$REQUEST_UUID" -u "stewart.chris1234@gmail.com" --team-id "9ZG3GPKHX8" -p "$MAC_NOTARIZATION_PW"
2021-05-19 16:38:32 -05:00
echo "Start while loop"
2021-06-15 10:06:03 -05:00
while xcrun altool --notarization-info "$REQUEST_UUID" -u "stewart.chris1234@gmail.com" --team-id "9ZG3GPKHX8" -p "$MAC_NOTARIZATION_PW" | grep "Status: in progress" > /dev/null; do
2021-05-19 16:38:32 -05:00
echo "Verification in progress..."
sleep 30
done
xcrun stapler staple ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
echo "Done stapling"
spctl -vvv --assess --type exec bitcoin-s.app
echo "Done inspecting app with spctl"
codesign -vvv --deep --strict ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
echo "Done verifying code signing deep"
codesign -dvv ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
echo "Done verifying artifacts"
ls -l
- name : 'Echo download path'
run : echo ${{steps.download.outputs.download-path}}
- name : Upload dmg
uses : actions/upload-artifact@v1
with :
2021-12-04 06:10:08 -06:00
name : "mac"
2021-05-19 16:38:32 -05:00
path : ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
2021-07-09 12:42:46 -05:00
- name : Upload if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2021-12-04 06:10:08 -06:00
name : "mac"
2021-10-17 12:56:24 -05:00
files : ${{ env.pkg-name }}-${{steps.previoustag.outputs.tag}}.dmg
2021-07-09 12:42:46 -05:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2021-05-19 16:38:32 -05:00
linux :
runs-on : [ ubuntu-latest ]
steps :
- uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
2022-02-21 15:52:24 -06:00
uses : olafurpg/setup-scala@v13
2021-05-19 16:38:32 -05:00
with :
2022-02-21 10:52:55 -06:00
java-version : openjdk@1.17.0
2021-05-19 16:38:32 -05:00
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 1.0 .0 # Optional fallback tag to use when no tag can be found
- name : Build fat jar
run : sbt "bundle/assembly"
- name : Package jar as debian package
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
2021-05-26 18:09:53 -05:00
run : "jpackage --linux-shortcut --name ${{ env.pkg-name }} --app-version ${{steps.previoustag.outputs.tag}} --type deb -i app/bundle/target/scala-2.13/ --main-class org.bitcoins.bundle.gui.BundleGUI --main-jar ${{ env.pkg-assembly }} --icon app/gui/src/main/resources/icons/bitcoin-s.png"
2021-05-19 16:38:32 -05:00
- name : View Artifacts
run : ls -l
- name : Print working dir
run : pwd
- name : Upload deb
uses : actions/upload-artifact@v1
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
2021-12-04 06:10:08 -06:00
name : "deb"
2021-05-19 16:38:32 -05:00
path : "${{ env.pkg-name }}_${{ steps.previoustag.outputs.tag }}-1_amd64.deb"
2021-07-09 12:42:46 -05:00
- name : Upload if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2021-12-04 06:10:08 -06:00
name : "deb"
2021-07-09 12:42:46 -05:00
files : "${{ env.pkg-name }}_${{ steps.previoustag.outputs.tag }}-1_amd64.deb"
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2021-06-17 07:20:07 -05:00
windows :
runs-on : [ windows-latest]
steps :
- name : Checkout repo
uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
2022-02-21 15:52:24 -06:00
uses : olafurpg/setup-scala@v13
2021-06-17 07:20:07 -05:00
with :
2022-02-21 10:52:55 -06:00
java-version : openjdk@1.17.0
2021-05-19 16:38:32 -05:00
2021-06-17 07:20:07 -05:00
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 1.0 .0 # Optional fallback tag to use when no tag can be found
- name : Build msi
shell : bash
run : sbt bundle/windows:packageBin
- name : View artifacts
run : ls -R .
- name : Upload installer
uses : actions/upload-artifact@v1
with :
2021-12-04 06:10:08 -06:00
name : windows
2021-06-17 07:20:07 -05:00
path : "D:\\a\\bitcoin-s\\bitcoin-s\\app\\bundle\\target\\windows\\bitcoin-s-bundle.msi"
2021-07-09 12:42:46 -05:00
- name : Upload if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2021-12-04 06:10:08 -06:00
name : windows
2021-07-09 12:42:46 -05:00
files : "D:\\a\\bitcoin-s\\bitcoin-s\\app\\bundle\\target\\windows\\bitcoin-s-bundle.msi"
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-05-07 18:42:02 -05:00
mac-zips :
runs-on : [ macos-latest ]
steps :
- uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
uses : olafurpg/setup-scala@v13
with :
java-version : openjdk@1.17.0
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 1.0 .0 # Optional fallback tag to use when no tag can be found
- name : Build zip
run : sbt "universal:stage;universal:packageBin"
- name : View Artifacts
run : ls -l app/server/target/universal/stage
- name : pwd
run : pwd
- name : Upload bitcoin-s-server-mac zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-server-mac"
path : app/server/target/universal/stage
- name : Upload bitcoin-s-oracle-server zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-oracle-server-mac"
path : app/oracle-server/target/universal/stage
- name : Upload bitcoin-s-cli zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-cli-mac"
path : app/cli/target/universal/stage/
- name : Upload bitcoin-s-server if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-server-mac-${{steps.previoustag.outputs.tag}}"
files : app/server/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Upload bitcoin-s-oracle-server if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-oracle-server-mac-${{steps.previoustag.outputs.tag}}"
files : app/oracle-server/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Upload bitcoin-s-cli if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-cli-mac-${{steps.previoustag.outputs.tag}}"
files : app/cli/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
linux-zips :
2022-03-09 06:43:47 -06:00
runs-on : [ ubuntu-latest ]
steps :
- uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
uses : olafurpg/setup-scala@v13
with :
java-version : openjdk@1.17.0
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 1.0 .0 # Optional fallback tag to use when no tag can be found
- name : Build zip
2022-04-18 12:31:46 -05:00
run : sbt "universal:stage;universal:packageBin"
2022-03-09 06:43:47 -06:00
- name : View Artifacts
run : ls -l app/server/target/universal/stage
- name : pwd
run : pwd
2022-05-07 18:42:02 -05:00
- name : Upload bitcoin-s-server-linux zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-server-linux"
path : app/server/target/universal/stage/
- name : Upload bitcoin-s-oracle-server-linux zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-oracle-server-linux"
path : app/oracle-server/target/universal/stage/
- name : Upload bitcoin-s-cli-linux zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
name : "bitcoin-s-cli-linux"
path : app/cli/target/universal/stage/
- name : Upload bitcoin-s-server if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-server-linux-${{steps.previoustag.outputs.tag}}"
files : app/server/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Upload bitcoin-s-oracle-server if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-oracle-server-linux-${{steps.previoustag.outputs.tag}}"
files : app/oracle-server/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Upload bitcoin-s-cli if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
name : "bitcoin-s-cli-linux-${{steps.previoustag.outputs.tag}}"
files : app/cli/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
windows-zips :
runs-on : [ windows-latest]
steps :
- uses : actions/checkout@v2
with :
fetch-depth : 0
- name : Setup Scala
uses : olafurpg/setup-scala@v13
with :
java-version : openjdk@1.17.0
- name : 'Get Previous tag'
id : previoustag
uses : "WyriHaximus/github-action-get-previous-tag@v1"
with :
fallback : 1.0 .0 # Optional fallback tag to use when no tag can be found
- name : Build zip
shell : bash
run : sbt "universal:stage;universal:packageBin"
- name : View Artifacts
run : ls -l app/server/target/universal/stage
- name : pwd
run : pwd
- name : Upload bitcoin-s-server-windows zip
2022-03-09 06:43:47 -06:00
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-server-windows"
2022-03-09 06:43:47 -06:00
path : app/server/target/universal/stage/
2022-04-30 06:30:58 -05:00
- name : Upload bitcoin-s-oracle-server zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-oracle-server-windows"
2022-04-30 06:30:58 -05:00
path : app/oracle-server/target/universal/stage/
- name : Upload bitcoin-s-cli zip
uses : actions/upload-artifact@v3
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-cli-windows"
2022-04-30 06:30:58 -05:00
path : app/cli/target/universal/stage/
- name : Upload bitcoin-s-server if release
2022-03-09 06:43:47 -06:00
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-server-windows-${{steps.previoustag.outputs.tag}}"
2022-04-18 12:31:46 -05:00
files : app/server/target/universal/*.zip
2022-03-09 06:43:47 -06:00
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-04-30 06:30:58 -05:00
- name : Upload bitcoin-s-oracle-server if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-oracle-server-windows-${{steps.previoustag.outputs.tag}}"
2022-04-30 06:30:58 -05:00
files : app/oracle-server/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name : Upload bitcoin-s-cli if release
uses : softprops/action-gh-release@v1
if : startsWith(github.ref, 'refs/tags/')
with :
2022-05-07 18:42:02 -05:00
name : "bitcoin-s-cli-windows-${{steps.previoustag.outputs.tag}}"
2022-04-30 06:30:58 -05:00
files : app/cli/target/universal/*.zip
env :
pkg-version : ${{steps.previoustag.outputs.tag}}
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}