@@ -152,6 +152,22 @@ jobs:
152152 runs-on : windows-latest
153153 steps :
154154 - uses : actions/checkout@v2
155+ - uses : oprypin/find-latest-tag@v1
156+ with :
157+ repository : CastellaniDavide/create_structure
158+ releases-only : true
159+ id : latest
160+
161+ - name : Set envirorment varible(s)
162+ run : |
163+ echo "::set-output name=PUSH_PATH::$(curl -sL https://api.github.com/repos/CastellaniDavide/create_structure/releases/latest | jq -r '.upload_url')"
164+ echo "::set-output name=VERSION_TAG::$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')"
165+ echo "::set-output name=TAR_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').orig.tar.gz"
166+ echo "::set-output name=DEB_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_amd64.deb"
167+ echo "::set-output name=CHANGES_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_source.changes"
168+ echo "::set-output name=NUPKG_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').nupkg"
169+ echo "::set-output name=NUPKG_FILE_PATH::./choco/createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').nupkg"
170+ id : envirorment-variables
155171 - name : Try to build
156172 run : |
157173 cd choco
@@ -163,9 +179,34 @@ jobs:
163179 runs-on : windows-latest
164180 steps :
165181 - uses : actions/checkout@v2
182+ - uses : oprypin/find-latest-tag@v1
183+ with :
184+ repository : CastellaniDavide/create_structure
185+ releases-only : true
186+ id : latest
187+ - name : Set envirorment varible(s)
188+ run : |
189+ echo "::set-output name=PUSH_PATH::$(curl -sL https://api.github.com/repos/CastellaniDavide/create_structure/releases/latest | jq -r '.upload_url')"
190+ echo "::set-output name=VERSION_TAG::$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')"
191+ echo "::set-output name=TAR_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').orig.tar.gz"
192+ echo "::set-output name=DEB_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_amd64.deb"
193+ echo "::set-output name=CHANGES_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//')_source.changes"
194+ echo "::set-output name=NUPKG_FILE::createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').nupkg"
195+ echo "::set-output name=NUPKG_FILE_PATH::./choco/createstructure_$(echo ${{ steps.latest.outputs.tag }} | sed 's/v//').nupkg"
196+ id : envirorment-variables
166197 - name : Build and publish
167198 run : |
168199 cd choco
169200 choco apikey --key ${{ secrets.CHOCO_APIKEY }} --source https://push.chocolatey.org/
170201 choco pack
171- choco push .\createstructure.7.1.nupkg --source https://push.chocolatey.org/
202+ choco push .\${{ steps.envirorment-variables.outputs.NUPKG_FILE }} --source https://push.chocolatey.org/
203+ move ${{ steps.envirorment-variables.outputs.NUPKG_FILE }} ../${{ steps.envirorment-variables.outputs.NUPKG_FILE }}
204+ - name : Upload nupkg
205+ uses : actions/upload-release-asset@v1
206+ env :
207+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
208+ with :
209+ upload_url : ${{ steps.envirorment-variables.outputs.PUSH_PATH }}
210+ asset_path : ${{ steps.envirorment-variables.outputs.NUPKG_FILE }}
211+ asset_name : ${{ steps.envirorment-variables.outputs.NUPKG_FILE }}
212+ asset_content_type : application/zip
0 commit comments