diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6223a7e5acf..5647d2004d01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,8 +55,38 @@ jobs: - name: Archive build output uses: actions/upload-artifact@v3 with: - name: rust-toolchain-ubuntu + name: rust-toolchain-x86_64-unknown-linux-gnu path: | rust/build/x86_64-unknown-linux-gnu/stage2 !rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src - !rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/rustc-src \ No newline at end of file + !rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/rustc-src + + release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Compress artifacts + shell: bash + run: | + ls -lha ./artifacts + mkdir assets + for DIR in $(ls ./artifacts); do + tar czf "assets/$DIR.tar.gz" -C "artifacts/$DIR" . + done + ls -lha ./assets + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "Installing gh CLI..." + curl -L https://github.com/cli/cli/releases/download/v2.17.0/gh_2.17.0_linux_amd64.tar.gz | \ + tar xvz --strip-components=2 --exclude=man + chmod +x ./gh + ./gh release create --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./assets/* || \ + ./gh release upload --repo "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" ./assets/* \ No newline at end of file