Skip to content

Commit

Permalink
Adapt the release workflow to SIP-46 (#20565)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal authored Jun 14, 2024
1 parent e4a5d9c commit de2d35c
Showing 1 changed file with 176 additions and 9 deletions.
185 changes: 176 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -769,13 +769,35 @@ jobs:

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true

- name: Prepare Release
run: |
# Extract the release tag
- name: Extract the release tag
run : echo "RELEASE_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
# BUILD THE SDKs
- name: Build and pack the SDK (universal)
run : |
./project/scripts/sbt dist/packArchive
sha256sum dist/target/scala3-* > dist/target/sha256sum.txt
echo "RELEASE_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV
- name: Build and pack the SDK (linux x86-64)
run : |
./project/scripts/sbt dist-linux-x86_64/packArchive
sha256sum dist/linux-x86_64/target/scala3-* > dist/linux-x86_64/target/sha256sum.txt
- name: Build and pack the SDK (linux aarch64)
run : |
./project/scripts/sbt dist-linux-aarch64/packArchive
sha256sum dist/linux-aarch64/target/scala3-* > dist/linux-aarch64/target/sha256sum.txt
- name: Build and pack the SDK (mac x86-64)
run : |
./project/scripts/sbt dist-mac-x86_64/packArchive
sha256sum dist/mac-x86_64/target/scala3-* > dist/mac-x86_64/target/sha256sum.txt
- name: Build and pack the SDK (mac aarch64)
run : |
./project/scripts/sbt dist-mac-aarch64/packArchive
sha256sum dist/mac-aarch64/target/scala3-* > dist/mac-aarch64/target/sha256sum.txt
- name: Build and pack the SDK (win x86-64)
run : |
./project/scripts/sbt dist-win-x86_64/packArchive
sha256sum dist/win-x86_64/target/scala3-* > dist/win-x86_64/target/sha256sum.txt
# Create the GitHub release
- name: Create GitHub Release
id: create_gh_release
uses: actions/create-release@latest
Expand All @@ -788,7 +810,7 @@ jobs:
draft: true
prerelease: ${{ contains(env.RELEASE_TAG, '-') }}

- name: Upload zip archive to GitHub Release
- name: Upload zip archive to GitHub Release (universal)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -797,8 +819,7 @@ jobs:
asset_path: ./dist/target/scala3-${{ env.RELEASE_TAG }}.zip
asset_name: scala3-${{ env.RELEASE_TAG }}.zip
asset_content_type: application/zip

- name: Upload tar.gz archive to GitHub Release
- name: Upload tar.gz archive to GitHub Release (universal)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -808,7 +829,103 @@ jobs:
asset_name: scala3-${{ env.RELEASE_TAG }}.tar.gz
asset_content_type: application/gzip

- name: Upload SHA256 sum of the release artefacts to GitHub Release
- name: Upload zip archive to GitHub Release (linux x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-pc-linux.zip
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-pc-linux.zip
asset_content_type: application/zip
- name: Upload tar.gz archive to GitHub Release (linux x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-pc-linux.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-pc-linux.tar.gz
asset_content_type: application/gzip

- name: Upload zip archive to GitHub Release (linux aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-aarch64/target/scala3-${{ env.RELEASE_TAG }}-aarch64-pc-linux.zip
asset_name: scala3-${{ env.RELEASE_TAG }}-aarch64-pc-linux.zip
asset_content_type: application/zip
- name: Upload tar.gz archive to GitHub Release (linux aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-aarch64/target/scala3-${{ env.RELEASE_TAG }}-aarch64-pc-linux.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}-aarch64-pc-linux.tar.gz
asset_content_type: application/gzip

- name: Upload zip archive to GitHub Release (mac x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-apple-darwin.zip
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-apple-darwin.zip
asset_content_type: application/zip
- name: Upload tar.gz archive to GitHub Release (mac x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-apple-darwin.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-apple-darwin.tar.gz
asset_content_type: application/gzip

- name: Upload zip archive to GitHub Release (mac aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-aarch64/target/scala3-${{ env.RELEASE_TAG }}-aarch64-apple-darwin.zip
asset_name: scala3-${{ env.RELEASE_TAG }}-aarch64-apple-darwin.zip
asset_content_type: application/zip
- name: Upload tar.gz archive to GitHub Release (mac aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-aarch64/target/scala3-${{ env.RELEASE_TAG }}-aarch64-apple-darwin.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}-aarch64-apple-darwin.tar.gz
asset_content_type: application/gzip

- name: Upload zip archive to GitHub Release (win x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/win-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-pc-win32.zip
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-pc-win32.zip
asset_content_type: application/zip
- name: Upload tar.gz archive to GitHub Release (win x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/win-x86_64/target/scala3-${{ env.RELEASE_TAG }}-x86_64-pc-win32.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}-x86_64-pc-win32.tar.gz
asset_content_type: application/gzip


- name: Upload SHA256 sum of the release artefacts to GitHub Release (universal)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -818,6 +935,56 @@ jobs:
asset_name: sha256sum.txt
asset_content_type: text/plain

- name: Upload SHA256 sum of the release artefacts to GitHub Release (linux x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-x86_64/target/sha256sum.txt
asset_name: sha256sum-x86_64-pc-linux.txt
asset_content_type: text/plain

- name: Upload SHA256 sum of the release artefacts to GitHub Release (linux aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/linux-aarch64/target/sha256sum-aarch64-pc-linux.txt
asset_name: sha256sum.txt
asset_content_type: text/plain

- name: Upload SHA256 sum of the release artefacts to GitHub Release (mac x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-x86_64/target/sha256sum.txt
asset_name: sha256sum-x86_64-apple-darwin.txt
asset_content_type: text/plain

- name: Upload SHA256 sum of the release artefacts to GitHub Release (mac aarch64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/mac-aarch64/target/sha256sum.txt
asset_name: sha256sum-aarch64-apple-darwin.txt
asset_content_type: text/plain

- name: Upload SHA256 sum of the release artefacts to GitHub Release (win x86-64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/win-x86_64/target/sha256sum.txt
asset_name: sha256sum-x86_64-pc-win32.txt
asset_content_type: text/plain

- name: Publish Release
run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonatypeBundleRelease"

Expand Down

0 comments on commit de2d35c

Please sign in to comment.