diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 27733a3..9f200fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,70 +83,81 @@ jobs: & .\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 run: | New-Item -ItemType Directory -Path "./artifact" Copy-Item "./build/refactor.exe" -Destination "./artifact/refactor.exe" - Compress-Archive -Path "./artifact/*" -DestinationPath "./artifact/artifact.zip" - - - name: Upload artifact - uses: actions/upload-artifact@v2 + Compress-Archive -Path "./artifact/*" -DestinationPath "./artifact/refactor-$(env:SHORT_SHA).zip" + - name: Upload Release + uses: ncipollo/release-action@v1 with: - name: artifact - path: ./artifact/artifact.zip + artifacts: ./artifact/refactor-${env:SHORT_SHA}.zip + omitBody: true + # bodyFile: "body.md" + allowUpdates: true + + # - name: Upload artifact + # uses: actions/upload-artifact@v2 + + # with: + # name: artifact + # path: ./artifact/artifact.zip - release: - needs: build - runs-on: ubuntu-latest + # release: + # needs: build + # runs-on: ubuntu-latest - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: artifact - path: ./artifact + # steps: + # - name: Download artifact + # uses: actions/download-artifact@v2 + # with: + # name: artifact + # path: ./artifact - - name: Extract artifact - run: | - unzip ./artifact/artifact.zip -d ./artifact + # - name: Extract artifact + # run: | + # unzip ./artifact/artifact.zip -d ./artifact - - name: Get Commit Count - run: echo ::set-output name=commit_count::$(git rev-list --count HEAD) - - - name: Create Git Tag - uses: anothrNick/github-tag-action@v1.19 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tag_name: v${{ steps.get_commit_count.outputs.commit_count }} + # - name: Create Git Tag + # uses: anothrNick/github-tag-action@v1.61.0 + # with: + # github_token: ${{ secrets.GITHUB_TOKEN }} + # WITH_V: true - - name: Create GitHub release - id: create_release - uses: actions/create-release@v1 + # - name: Create GitHub release + # id: create_release + # uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ steps.get_commit_count.outputs.commit_count }} - release_name: Release v${{ steps.get_commit_count.outputs.commit_count }} - draft: false - prerelease: false + # with: + # tag_name: v${{ steps.get_commit_count.outputs.commit_count }} + # release_name: Release v${{ steps.get_commit_count.outputs.commit_count }} + # draft: false + # prerelease: false - - name: Upload refactor.exe to the release - uses: actions/upload-release-asset@v1 + # - name: Upload refactor.exe to the release + # uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./artifact/refactor.exe - asset_name: refactor.exe - asset_content_type: application/octet-stream + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./artifact/refactor-${env:SHORT_SHA}.zip + # asset_name: refactor-${env:SHORT_SHA}.zip + # asset_content_type: application/octet-stream