camunda-community-hub / community-action-maven-release

Opinionated GitHub action to release community projects to Maven Central
Apache License 2.0
7 stars 4 forks source link

Adding artifacts on Github does not work #52

Closed berndruecker closed 1 year ago

berndruecker commented 1 year ago

See https://github.com/camunda-community-hub/community-hub-extension-example/actions/runs/4062895558/jobs/6994482279#step:5:1410 - this currently doesn't work.

Looks you (@zambrovski ) add files to the Github env in the action:

    - name: Archive artifacts
      id: create-archive
      run: |-
        test -z "${{ inputs.artifacts-pattern }}" && echo "::debug::Skipping archiving because artifacts-pattern is unset" && exit 0
        # Filename: [repo without org]-[version].zip
        ZIPFILE=${GITHUB_REPOSITORY#*/}-${{ inputs.release-version }}.zip
        zip $ZIPFILE $(find . -path ${{ inputs.artifacts-pattern }})
        echo "filename=${ZIPFILE}" >> $GITHUB_ENV
      shell: bash

This was different in an older version of the action: https://github.com/camunda-community-hub/community-action-maven-release/blob/a7af046fe7badb05a6a91e8e8fc014518957381f/action.yml#L162

And the workflow actually would require the output to be used.

      - if: github.event.release
        name: Attach artifacts to GitHub Release (Release only)
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: ${{ steps.release.outputs.artifacts_archive_path }}
          asset_name: ${{ steps.release.outputs.artifacts_archive_path }}
          asset_content_type: application/zip

Shall I revert that change to the original version to make the workflow work again @zambrovski ?

zambrovski commented 1 year ago

The echo "::set-output name=filename::${ZIPFILE}" is actually deprecated by GitHub Actions (as stated here: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/). Probably I made a mistake in mapping the output to the output of the action.

Let do two things: please revert this line to the set-output and lets open a new issue to remove the deprecated stuff.

berndruecker commented 1 year ago

Thanks for the context - I think I spotted the error and will try to fix it now

berndruecker commented 1 year ago

Works now: https://github.com/camunda-community-hub/community-hub-extension-example/releases/tag/0.0.4 👍