How can I make GitHub actions give me a jar file not a zip?

Viewed 495

I set up github actions for my java repo (a spigot plugin) but it always gives me a zip file with the jar I want inside it, when it should just be giving me the jar. Is there any way to make it just give me a jar?

name: Build plugin

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8

    - name: Build with Maven
      run: mvn -B package --file pom.xml

    - name: Archive artifacts
      uses: actions/upload-artifact@v2
      with:
        name: GeyserUpdater
        path: |
          target/*.jar
          !target/original-*.jar
1 Answers

During a workflow run, files are uploaded and downloaded individually using the upload-artifact and download-artifact actions. However, when a workflow run finishes and an artifact is downloaded from either the UI or through the download api, a zip is dynamically created with all the file contents that were uploaded. There is currently no way to download artifacts after a workflow run finishes in a format other than a zip or to download artifact contents individually. One of the consequences of this limitation is that if a zip is uploaded during a workflow run and then downloaded from the UI, there will be a double zip created.

https://github.com/marketplace/actions/upload-a-build-artifact

Related