Skip to content

Commit 55d3da4

Browse files
authored
Update actions
1 parent 3e4cd57 commit 55d3da4

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

.github/workflows/on-push.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,4 @@ jobs:
160160
cd choco
161161
choco pack
162162
choco install createstructure -d-v -s . --pre -y --force
163-
164-
# - name: Upload nupkg
165-
# uses: actions/upload-release-asset@v1
166-
# env:
167-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168-
# with:
169-
# upload_url: ${{ steps.envirorment-variables.outputs.PUSH_PATH }}
170-
# asset_path: ${{ steps.envirorment-variables.outputs.NUPKG_FILE }}
171-
# asset_name: ${{ steps.envirorment-variables.outputs.NUPKG_FILE }}
172-
# asset_content_type: application/zip
163+
move ${{ steps.envirorment-variables.outputs.NUPKG_FILE }} ../${{ steps.envirorment-variables.outputs.NUPKG_FILE }}

.github/workflows/on-release.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)