Another release attempt

This commit is contained in:
Edward R. Gonzalez 2023-03-30 22:31:07 -04:00
parent 2fe7ded7ec
commit 1d807eaf0a

View File

@ -83,70 +83,81 @@ jobs:
& .\scripts\build.ci.ps1 debug test & .\scripts\build.ci.ps1 debug test
- name: Get Short Commit SHA
shell: pwsh
run: |
$shortSHA = $env:github_sha.Substring(0, 7)
echo "Short SHA: $shortSHA"
echo "SHORT_SHA=$shortSHA" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Create - name: Create Package
shell: pwsh shell: pwsh
run: | run: |
New-Item -ItemType Directory -Path "./artifact" New-Item -ItemType Directory -Path "./artifact"
Copy-Item "./build/refactor.exe" -Destination "./artifact/refactor.exe" Copy-Item "./build/refactor.exe" -Destination "./artifact/refactor.exe"
Compress-Archive -Path "./artifact/*" -DestinationPath "./artifact/artifact.zip" Compress-Archive -Path "./artifact/*" -DestinationPath "./artifact/refactor-$(env:SHORT_SHA).zip"
- name: Upload artifact
uses: actions/upload-artifact@v2
- name: Upload Release
uses: ncipollo/release-action@v1
with: with:
name: artifact artifacts: ./artifact/refactor-${env:SHORT_SHA}.zip
path: ./artifact/artifact.zip omitBody: true
# bodyFile: "body.md"
allowUpdates: true
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: artifact
# path: ./artifact/artifact.zip
release: # release:
needs: build # needs: build
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- name: Download artifact # - name: Download artifact
uses: actions/download-artifact@v2 # uses: actions/download-artifact@v2
with: # with:
name: artifact # name: artifact
path: ./artifact # path: ./artifact
- name: Extract artifact # - name: Extract artifact
run: | # run: |
unzip ./artifact/artifact.zip -d ./artifact # unzip ./artifact/artifact.zip -d ./artifact
- name: Get Commit Count # - name: Create Git Tag
run: echo ::set-output name=commit_count::$(git rev-list --count HEAD) # uses: anothrNick/github-tag-action@v1.61.0
# with:
- name: Create Git Tag # github_token: ${{ secrets.GITHUB_TOKEN }}
uses: anothrNick/github-tag-action@v1.19 # WITH_V: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_name: v${{ steps.get_commit_count.outputs.commit_count }}
- name: Create GitHub release # - name: Create GitHub release
id: create_release # id: create_release
uses: actions/create-release@v1 # uses: actions/create-release@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
tag_name: v${{ steps.get_commit_count.outputs.commit_count }} # tag_name: v${{ steps.get_commit_count.outputs.commit_count }}
release_name: Release v${{ steps.get_commit_count.outputs.commit_count }} # release_name: Release v${{ steps.get_commit_count.outputs.commit_count }}
draft: false # draft: false
prerelease: false # prerelease: false
- name: Upload refactor.exe to the release # - name: Upload refactor.exe to the release
uses: actions/upload-release-asset@v1 # uses: actions/upload-release-asset@v1
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: # with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifact/refactor.exe # asset_path: ./artifact/refactor-${env:SHORT_SHA}.zip
asset_name: refactor.exe # asset_name: refactor-${env:SHORT_SHA}.zip
asset_content_type: application/octet-stream # asset_content_type: application/octet-stream