Changeset 17487 in josm for trunk/.github/workflows/ant.yml


Ignore:
Timestamp:
2021-02-08T20:52:53+01:00 (4 years ago)
Author:
GerdP
Message:

see #20257:macOS build process fixes and improvements

File:
1 edited

Legend:

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

    r17373 r17487  
    2424      josm_revision: ${{ steps.create_revision.outputs.josm_revision }}
    2525      josm_prerelease: ${{ steps.create_revision.outputs.josm_prerelease }}
     26      josm_release_tag: ${{ steps.create_revision.outputs.josm_release_tag }}
    2627    steps:
    2728      - name: Checkout
    2829        uses: actions/checkout@v2
    2930        with:
    30           fetch-depth: 32
     31          fetch-depth: 256
    3132      - name: Set revision env variable
    3233        id: create_revision
     
    3536          josm_revision="$(git log -1 --grep 'git-svn-id: https://josm.openstreetmap.de/svn/trunk@' --pretty=format:%B | tail -1 | sed -n 's%git-svn-id: https://josm.openstreetmap.de/svn/trunk@\([0-9]*\) [-0-9a-f]*%\1%p')"
    3637          if [[ "$josm_revision" == "$(curl --silent https://josm.openstreetmap.de/tested)" ]]; then
    37             sed -i '/Is-Local-Build/d' resources/REVISION
    3838            echo "josm_prerelease=false" >> $GITHUB_ENV
    3939            echo "::set-output name=josm_prerelease::false"
    40             echo "josm_release=$josm_revision-tested" >> $GITHUB_ENV
     40            josm_release_tag=$josm_revision-tested
    4141          else
    4242            echo "josm_prerelease=true" >> $GITHUB_ENV
    4343            echo "::set-output name=josm_prerelease::true"
    44             echo "josm_release=$josm_revision" >> $GITHUB_ENV
     44            josm_release_tag=$josm_revision
    4545          fi
    4646          echo "josm_revision=$josm_revision" >> $GITHUB_ENV
    4747          echo "::set-output name=josm_revision::$josm_revision"
     48          echo "josm_release_tag=$josm_release_tag" >> $GITHUB_ENV
     49          echo "::set-output name=josm_release_tag::$josm_release_tag"
    4850      - name: Create release
    4951        id: create_release
     
    5254          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
    5355        with:
    54           tag_name: ${{ env.josm_release }}
    55           release_name: JOSM.app release ${{ env.josm_release }}
     56          tag_name: ${{ env.josm_release_tag }}
     57          release_name: JOSM.app release ${{ env.josm_release_tag }}
    5658          body: |
    57             JOSM.app release ${{ env.josm_release }}
     59            JOSM.app release ${{ env.josm_release_tag }}
    5860          draft: false
    5961          prerelease: ${{ env.josm_prerelease }}
     
    8486        uses: actions/checkout@v2
    8587        with:
    86           fetch-depth: 32
     88          fetch-depth: 256
    8789      - name: Cache
    8890        uses: actions/cache@v2.0.0
     
    120122          defaults write net.pornel.ImageOptim PngOutEnabled 1
    121123          /Applications/ImageOptim.app/Contents/MacOS/ImageOptim resources/images
     124      - name: Set Is-Local-Build
     125        if: ${{ ! needs.createrelease.outputs.josm_prerelease }}
     126        run: |
     127          ant create-revision
     128          sed -i.bak '/Is-Local-Build/d' resources/REVISION
    122129      - name: Build with Ant
    123130        # Disables errorprone for Java 16
     
    130137          fi
    131138      - name: Upload jar
    132         if: ${{ always() && matrix.headless }}
     139        # Only run on matrix.headless to avoid double jars. They should be the same jars.
     140        # uses `gh release upload` to avoid https://github.com/actions/upload-release-asset/issues/69
     141        if: ${{ always() && matrix.headless == 'true' }}
    133142        id: upload-jar
     143        env:
     144          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    134145        uses: actions/upload-release-asset@v1
    135         env:
    136           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    137146        with:
    138147          upload_url: ${{ needs.createrelease.outputs.upload_url }} # This pulls from the CREATE RELEASE job above, referencing its ID to get its outputs object, which include a `upload_url`.
     
    140149          asset_name: JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}.jar
    141150          asset_content_type: application/java-archive
     151        # run: |
     152        #   cp dist/josm-custom.jar JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}.jar
     153        #   gh release upload ${{ needs.createrelease.outputs.josm_release_tag }} JOSM-${{ runner.os}}-java${{ matrix.java }}-${{ needs.createrelease.outputs.josm_revision }}.jar
    142154      - name: Test with Ant, headless ${{ matrix.headless }}
    143155        if: ${{ needs.createrelease.outputs.josm_prerelease }}
     
    158170          name: Ant reports for JOSM ${{ needs.createrelease.outputs.josm_revision }} on java ${{ matrix.java }} on ${{ matrix.os }} with headless=${{ matrix.headless }}
    159171          path: test/report/*.txt
     172      - name: Publish Test Report with junit-report-annotations-action
     173        uses: ashley-taylor/junit-report-annotations-action@1.3
     174        if: always()
     175        with:
     176          access-token: ${{ secrets.GITHUB_TOKEN }}
     177          path: 'test/report/TEST*.xml'
     178      - name: Publish Test Report with action-junit-report
     179        if: always()
     180        uses: mikepenz/action-junit-report@v1
     181        with:
     182          report_paths: 'test/report/TEST*.xml'
     183          github_token: ${{ secrets.GITHUB_TOKEN }}
    160184      - name: Build and package for macOS
    161185        if: ${{ runner.os == 'macos' && always() }}
Note: See TracChangeset for help on using the changeset viewer.