From 3117ec32a036dd667772afdfa85165cd534fbb72 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 17 Aug 2021 17:08:45 +0100 Subject: [PATCH] test file upload to release --- .github/workflows/release.yml | 24 ------------------------ .github/workflows/uploadtarball.yml | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/uploadtarball.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8feaa253..b850c0cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,27 +17,3 @@ jobs: uses: softprops/action-gh-release@v1 with: name: Netdisco ${{ steps.get_tag.outputs.TAGVALUE }} - - name: get upload url 2 - run: echo ${{ steps.create_release.outputs.upload_url }} - - name: get upload url - run: echo ${{ steps.create_release.outputs.upload_url }} > uploadurl.txt - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 -#jobs: -# build: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@master -# - name: Get the Tag -# id: get_tag -# run: echo ::set-output name=TAGVALUE::${GITHUB_REF#refs/tags/} -# - name: Netdisco Release -# env: -# GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} -# run: | -# curl -sL -X POST -H "Content-Type: application/json" \ -# -u "$GITHUB_TOKEN" \ -# --data "{\"tag_name\": \"${{ steps.get_tag.outputs.TAGVALUE }}\", \ -# \"target_commitish\": \"master\", \ -# \"name\": \"Netdisco ${{ steps.get_tag.outputs.TAGVALUE }}\"}" \ -# https://api.github.com/repos/netdisco/netdisco/releases diff --git a/.github/workflows/uploadtarball.yml b/.github/workflows/uploadtarball.yml new file mode 100644 index 00000000..9f2248ec --- /dev/null +++ b/.github/workflows/uploadtarball.yml @@ -0,0 +1,23 @@ +name: Upload Renamed Tarball +on: + release: + types: ['published'] +jobs: + upload_renamed_tarball: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Get the Tag + id: get_tag + run: echo ::set-output name=TAGVALUE::${GITHUB_REF#refs/tags/} + - name: Download tarball + run: curl -O https://github.com/netdisco/netdisco/archive/refs/tags/${{ steps.get_tag.outputs.TAGVALUE }}.tar.gz + - name: Rename tarball + run: mv ${{ steps.get_tag.outputs.TAGVALUE }}.tar.gz netdisco-mibs.tar.gz + - name: Upload tarball + uses: JasonEtco/upload-to-release@master + with: + args: netdisco-mibs.tar.gz application/gzip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}