Skip to content

Commit

Permalink
Use secrets.UNITY_EMAIL/_PASSWORD/_SERIAL if present, otherwise use h…
Browse files Browse the repository at this point in the history
…ardcoded free license (#74)

If Github Secrets UINTY_SERIAL is defined, then the build actions will
be run with the value of Github Secrets UNITY_SERIAL, UNITY_EMAIL, and
UNITY_PASSWORD.

If not, it will use the free license included in this file.

This means that builds from the main repo itself can use a protected
professional license, whereas PRs from forks (which do not have access
to the github secrets, for security reasons (to avoid leaking
credentials)) can still be built, albeit with a free license (i.e., with
a splash screen).
  • Loading branch information
mikeage authored Mar 31, 2021
1 parent a23e94f commit 58d37c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ on:
- "v*"

env:
#UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_LICENSE: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>\n <License id=\"Terms\">\n <MachineBindings>\n <Binding Key=\"1\" Value=\"576562626572264761624c65526f7578\"/>\n <Binding Key=\"2\" Value=\"576562626572264761624c65526f7578\"/>\n </MachineBindings>\n <MachineID Value=\"D7nTUnjNAmtsUMcnoyrqkgIbYdM=\"/>\n <SerialHash Value=\"b24e2ad2b9d60ad5aace4fde9911fc1c1f659e36\"/>\n <Features>\n <Feature Value=\"33\"/>\n <Feature Value=\"1\"/>\n <Feature Value=\"12\"/>\n <Feature Value=\"2\"/>\n <Feature Value=\"24\"/>\n <Feature Value=\"3\"/>\n <Feature Value=\"36\"/>\n <Feature Value=\"17\"/>\n <Feature Value=\"19\"/>\n <Feature Value=\"62\"/>\n </Features>\n <DeveloperData Value=\"AQAAAEY0LURFQ1ktRDhXTS01OTRHLUU5UlctQ0FYOA==\"/>\n <SerialMasked Value=\"F4-DECY-D8WM-594G-E9RW-XXXX\"/>\n <StartDate Value=\"2021-02-07T00:00:00\"/>\n <UpdateDate Value=\"2021-03-10T23:13:19\"/>\n <InitialActivationDate Value=\"2021-02-07T12:51:19\"/>\n <LicenseVersion Value=\"6.x\"/>\n <ClientProvidedVersion Value=\"2019.4.18f1\"/>\n <AlwaysOnline Value=\"false\"/>\n <Entitlements>\n <Entitlement Ns=\"unity_editor\" Tag=\"UnityPersonal\" Type=\"EDITOR\" ValidTo=\"9999-12-31T00:00:00\"/>\n <Entitlement Ns=\"unity_editor\" Tag=\"DarkSkin\" Type=\"EDITOR_FEATURE\" ValidTo=\"9999-12-31T00:00:00\"/>\n </Entitlements>\n </License>\n<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><SignedInfo><CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\"/><SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"/><Reference URI=\"#Terms\"><Transforms><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"/></Transforms><DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/><DigestValue>EQ57QnLpZQy5Ft2KgPCV+PcFuPg=</DigestValue></Reference></SignedInfo><SignatureValue>z+iLsAtgjx6jf0J41On79ErzFJdljmwNPvvBUEMpsdzf4E6GjFZIzpUfn1BA5livZmnmWTI3eF1V\nJ+0aIjkVfAIo0M8yhKcM1vj4+mUMhO7xZh3ipDtlnakdATvWrOBBFWLQO4rYADdkfvmIG1uLaadq\nGiTsxaXA/Vap2ffI+ECeUqtBdIwHLON4vEL6p1VKyUfbtAoafxnr9d1+kQaH0TAe60/J1Z8D6kmP\n5M/iCoWQaFq+Zo+0ACiXQikPt17lIhlwX0be+FuSa0WOwOBSnJyuzy+cpsd4ZQi724rQKbNtOx7M\nxq+FlamO+TPP26L6zIes+zfHCa/WD1+d9r1kuQ==</SignatureValue></Signature></root>"
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
# If UNITY_SERIAL is not set, then use a hardcoded license. Otherwise, don't set this, so the game-ci actions will use EMAIL/PASS/SERIAL
UNITY_LICENSE: ${{ fromJSON('["<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>\n <License id=\"Terms\">\n <MachineBindings>\n <Binding Key=\"1\" Value=\"576562626572264761624c65526f7578\"/>\n <Binding Key=\"2\" Value=\"576562626572264761624c65526f7578\"/>\n </MachineBindings>\n <MachineID Value=\"D7nTUnjNAmtsUMcnoyrqkgIbYdM=\"/>\n <SerialHash Value=\"b24e2ad2b9d60ad5aace4fde9911fc1c1f659e36\"/>\n <Features>\n <Feature Value=\"33\"/>\n <Feature Value=\"1\"/>\n <Feature Value=\"12\"/>\n <Feature Value=\"2\"/>\n <Feature Value=\"24\"/>\n <Feature Value=\"3\"/>\n <Feature Value=\"36\"/>\n <Feature Value=\"17\"/>\n <Feature Value=\"19\"/>\n <Feature Value=\"62\"/>\n </Features>\n <DeveloperData Value=\"AQAAAEY0LURFQ1ktRDhXTS01OTRHLUU5UlctQ0FYOA==\"/>\n <SerialMasked Value=\"F4-DECY-D8WM-594G-E9RW-XXXX\"/>\n <StartDate Value=\"2021-02-07T00:00:00\"/>\n <UpdateDate Value=\"2021-03-10T23:13:19\"/>\n <InitialActivationDate Value=\"2021-02-07T12:51:19\"/>\n <LicenseVersion Value=\"6.x\"/>\n <ClientProvidedVersion Value=\"2019.4.18f1\"/>\n <AlwaysOnline Value=\"false\"/>\n <Entitlements>\n <Entitlement Ns=\"unity_editor\" Tag=\"UnityPersonal\" Type=\"EDITOR\" ValidTo=\"9999-12-31T00:00:00\"/>\n <Entitlement Ns=\"unity_editor\" Tag=\"DarkSkin\" Type=\"EDITOR_FEATURE\" ValidTo=\"9999-12-31T00:00:00\"/>\n </Entitlements>\n </License>\n<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><SignedInfo><CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\"/><SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"/><Reference URI=\"#Terms\"><Transforms><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"/></Transforms><DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/><DigestValue>EQ57QnLpZQy5Ft2KgPCV+PcFuPg=</DigestValue></Reference></SignedInfo><SignatureValue>z+iLsAtgjx6jf0J41On79ErzFJdljmwNPvvBUEMpsdzf4E6GjFZIzpUfn1BA5livZmnmWTI3eF1V\nJ+0aIjkVfAIo0M8yhKcM1vj4+mUMhO7xZh3ipDtlnakdATvWrOBBFWLQO4rYADdkfvmIG1uLaadq\nGiTsxaXA/Vap2ffI+ECeUqtBdIwHLON4vEL6p1VKyUfbtAoafxnr9d1+kQaH0TAe60/J1Z8D6kmP\n5M/iCoWQaFq+Zo+0ACiXQikPt17lIhlwX0be+FuSa0WOwOBSnJyuzy+cpsd4ZQi724rQKbNtOx7M\nxq+FlamO+TPP26L6zIes+zfHCa/WD1+d9r1kuQ==</SignatureValue></Signature></root>", null]')[secrets.UNITY_SERIAL != null] }}

jobs:
configuration:
Expand Down

0 comments on commit 58d37c3

Please sign in to comment.