diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c061148..e7b5dae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,14 @@ on: jobs: build: name: Publish binaries - runs-on: windows-latest + strategy: + matrix: + kind: ['windows'] + include: + - kind: windows + os: windows-latest + target: win-x64 + runs-on: ${{ matrix.os }} steps: - name: Setup Developer Command Prompt @@ -28,24 +35,23 @@ jobs: working-directory: ${{env.GITHUB_WORKSPACE}} run: bin.ntx64\jam.exe -v - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} - draft: false - prerelease: false - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 + - name: Package + shell: bash + working-directory: ${{env.GITHUB_WORKSPACE}} + run: | + tag=$(git describe --tags --abbrev=0) + release_name="jam-$tag-${{ matrix.target }}" + + # Pack files + if [ "${{ matrix.target }}" == "win-x64" ]; then + 7z a -tzip "${release_name}.zip" "./bin.ntx64/jam.exe" + else + tar czvf "${release_name}.tar.gz" "bin.ntx64/jam" + fi + + - name: Release + uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./bin.ntx64/jam.exe - asset_name: jam.exe (Windows x64) - asset_content_type: application/octet-stream \ No newline at end of file + files: "jam-*"