diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 67560897..1527c95e 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -74,7 +74,6 @@ jobs: run: | mkdir -p output/{init,bash_completion,zsh_completion} cp sftpgo output/ - chmod 755 output/sftpgo cp sftpgo.json output/ cp -r templates output/ cp -r static output/ @@ -223,7 +222,6 @@ jobs: ./sftpgo gen man -d output/man/man1 gzip output/man/man1/* cp sftpgo output/ - chmod 755 output/sftpgo - uses: uraimo/run-on-arch-action@v2.0.9 if: ${{ matrix.arch != 'amd64' }} @@ -261,7 +259,6 @@ jobs: ./sftpgo gen man -d output/man/man1 gzip output/man/man1/* cp sftpgo output/ - chmod 755 output/sftpgo - name: Upload build artifact uses: actions/upload-artifact@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04ed847d..446a4a98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: with: name: upload_url path: ./upload_url.txt + retention-days: 1 release-sources-with-deps: name: Publish sources @@ -339,6 +340,13 @@ jobs: tar cJvf sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_${{ matrix.tar-arch }}.tar.xz * cd .. + - name: Upload build artifact + uses: actions/upload-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_${{ matrix.tar-arch }}.tar.xz + path: ./output/sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_${{ matrix.tar-arch }}.tar.xz + retention-days: 1 + - name: Build Packages id: build_linux_pkgs run: | @@ -390,4 +398,69 @@ jobs: upload_url: ${{ steps.upload_url.outputs.url }} asset_path: ./pkgs/dist/rpm/sftpgo-${{ steps.build_linux_pkgs.outputs.pkg-version }}-1.${{ matrix.rpm-arch}}.rpm asset_name: sftpgo-${{ steps.build_linux_pkgs.outputs.pkg-version }}-1.${{ matrix.rpm-arch}}.rpm - asset_content_type: application/x-rpm \ No newline at end of file + asset_content_type: application/x-rpm + + publish-linux-bundle: + name: Publish Linux bundle + needs: publish-linux + runs-on: ubuntu-latest + + steps: + - name: Get versions + id: get_version + run: | + echo ::set-output name=SFTPGO_VERSION::${GITHUB_REF/refs\/tags\//} + shell: bash + + - name: Download amd64 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_x86_64.tar.xz + + - name: Download arm64 artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_arm64.tar.xz + + - name: Download ppc64le artifact + uses: actions/download-artifact@v2 + with: + name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_ppc64le.tar.xz + + - name: Build bundle + shell: bash + run: | + mkdir -p bundle/{arm64,ppc64le} + cd bundle + tar xvf ../sftpgo_${SFTPGO_VERSION}_linux_x86_64.tar.xz + cd arm64 + tar xvf ../../sftpgo_${SFTPGO_VERSION}_linux_arm64.tar.xz sftpgo + cd ../ppc64le + tar xvf ../../sftpgo_${SFTPGO_VERSION}_linux_ppc64le.tar.xz sftpgo + cd .. + tar cJvf sftpgo_${SFTPGO_VERSION}_linux_bundle.tar.xz * + cd .. + env: + SFTPGO_VERSION: ${{ steps.get_version.outputs.SFTPGO_VERSION }} + + - name: Download release upload URL + uses: actions/download-artifact@v2 + with: + name: upload_url + + - name: Get release upload URL + id: upload_url + run: | + URL=$(cat upload_url.txt) + echo "::set-output name=url::${URL}" + shell: bash + + - name: Upload Linux bundle + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.upload_url.outputs.url }} + asset_path: ./bundle/sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_bundle.tar.xz + asset_name: sftpgo_${{ steps.get_version.outputs.SFTPGO_VERSION }}_linux_bundle.tar.xz + asset_content_type: application/x-xz \ No newline at end of file