Skip to content

Commit

Permalink
Update the workflows to bundle the msi
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Jul 2, 2024
1 parent 96d05e2 commit 1e2be00
Show file tree
Hide file tree
Showing 3 changed files with 327 additions and 260 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
### ###
### NOTE: ###
### - WE SHOULD BUILD SCALA USING JAVA 8 ###
### - THE GENERATED MSI WILL ALWAYS HAVE THE STABLE VERSION NUMBER ###
###################################################################################################

name: Build the MSI Package
Expand Down
270 changes: 10 additions & 260 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -726,268 +726,18 @@ jobs:
publish_branch: gh-pages

publish_release:
permissions:
contents: write # for actions/create-release to create a release
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2023-11-07
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
needs: [test_non_bootstrapped, test, mima, community_build_a, community_build_b, community_build_c, test_sbt, test_java8]
if: "github.event_name == 'push'
&& startsWith(github.event.ref, 'refs/tags/')"

env:
RELEASEBUILD: yes
PGP_PW: ${{ secrets.PGP_PW }} # PGP passphrase
PGP_SECRET: ${{ secrets.PGP_SECRET }} # Export your private and public PGP key to an *.asc file, take the file's contents as a string
uses: ./.github/workflows/release-stable.yml
with:
version: ${{ github.ref_name }}
secrets:
PGP_PW: ${{ secrets.PGP_PW }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PW: ${{ secrets.SONATYPE_PW_ORGSCALALANG }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER_ORGSCALALANG }}

steps:
######################################################################################
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
######################################################################################
- name: Set JDK 8 as default
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Reset existing repo
run: |
git config --global --add safe.directory /__w/scala3/scala3
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
- name: Checkout cleanup script
uses: actions/checkout@v4

- name: Cleanup
run: .github/workflows/cleanup.sh

- name: Git Checkout
uses: actions/checkout@v4

- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
# 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
- 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: ./changelogs/${{ env.RELEASE_TAG }}.md
draft: true
prerelease: ${{ contains(env.RELEASE_TAG, '-') }}

- name: Upload zip archive to GitHub Release (universal)
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/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 (universal)
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/target/scala3-${{ env.RELEASE_TAG }}.tar.gz
asset_name: scala3-${{ env.RELEASE_TAG }}.tar.gz
asset_content_type: application/gzip

- 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 }}
with:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
asset_path: ./dist/target/sha256sum.txt
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.txt
asset_name: sha256sum-aarch64-pc-linux.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"

needs: [test_non_bootstrapped, test, mima, community_build_a, community_build_b, community_build_c, test_sbt, test_java8]
if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')"
permissions:
contents: write # To create a GitHub Release

open_issue_on_failure:
runs-on: [self-hosted, Linux]
Expand Down
Loading

0 comments on commit 1e2be00

Please sign in to comment.