Changeset 18142 in josm


Ignore:
Timestamp:
2021-08-20T20:51:45+02:00 (3 years ago)
Author:
Don-vip
Message:

see #17083 - sign jar files built on Github

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/ant.yml

    r18140 r18142  
    116116
    117117      - name: Build with Ant
     118        env:
     119          SIGN_ALIAS: ${{ secrets.SIGN_ALIAS }}
     120          SIGN_CERT: ${{ secrets.SIGN_CERT }}
     121          SIGN_KEYPASS: ${{ secrets.SIGN_KEYPASS }}
     122          SIGN_STOREPASS: ${{ secrets.SIGN_STOREPASS }}
     123          SIGN_TSA: ${{ secrets.SIGN_TSA }}
    118124        # Calls ant with -Dreleasebuild=true if we're a 'tested' build
    119125        run: |
     126          SIGN_KEYSTORE=certificate.p12
     127          echo "$SIGN_CERT" | base64 --decode > $SIGN_KEYSTORE
    120128          if [ "${{ needs.createrelease.outputs.josm_prerelease }}" == "true" ]; then
    121129            ANT="${{ env.ANT_HOME }}/bin/ant"
     
    124132          fi
    125133          $ANT dist
     134          rm $SIGN_KEYSTORE
    126135
    127136      - name: Upload jar
  • trunk/build.xml

    r18072 r18142  
    4141        <property name="test.dir" location="${base.dir}/test"/>
    4242        <property name="src.dir" location="${base.dir}/src"/>
     43        <condition property="sign.jar">
     44            <and>
     45                <isset property="env.SIGN_ALIAS"/>
     46                <isset property="env.SIGN_KEYSTORE"/>
     47                <isset property="env.SIGN_KEYPASS"/>
     48                <isset property="env.SIGN_STOREPASS"/>
     49                <isset property="env.SIGN_TSA"/>
     50            </and>
     51        </condition>
    4352        <condition property="noJavaFX">
    4453            <or>
     
    176185            </manifest>
    177186        </jar>
     187        <!-- Sign jar if all environment variables are set -->
     188        <signjar jar="${dist.jar}" alias="${env.SIGN_ALIAS}" tsaurl="${env.SIGN_TSA}"
     189            keystore="${env.SIGN_KEYSTORE}" storepass="${env.SIGN_STOREPASS}" keypass="${env.SIGN_KEYPASS}" if:set="sign.jar" />
    178190    </target>
    179191    <!-- Windows target -->
Note: See TracChangeset for help on using the changeset viewer.