Perform Release #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Perform Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'The release version' | |
required: true | |
type: string | |
jobs: | |
make-binaries: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-20.04] | |
include: | |
- os: macos-latest | |
platform: macos-x86 | |
artifact: bsp4bazel-macos-x86 | |
- os: ubuntu-20.04 | |
platform: linux-ubuntu-20.04 | |
artifact: bsp4bazel-linux-x86 | |
name: Make binaries for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Print version | |
run: | | |
echo Performing release for ${{ inputs.version }} | |
- uses: VirtusLab/scala-cli-setup@main | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
version: 'latest' | |
java-version: '17' | |
components: 'native-image' | |
cache: 'sbt' | |
# Update version in build.sbt first, as that gets backed into the native-image (via sbt-buildinfo) | |
- name: Update version and build native image | |
run: | | |
scala-cli .github/ci_scripts/updateVersion.scala -- build.sbt "^val bsp4BazelVersion" ${{ inputs.version }} | |
sbt clean compile graalvm-native-image:packageBin | |
./.github/ci_scripts/prepare_output.sh target/graalvm-native-image/bsp4bazel staging ${{ matrix.artifact }} | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact }} | |
path: staging | |
make_release: | |
name: Make release | |
needs: [make-binaries] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: "repo" | |
- uses: VirtusLab/scala-cli-setup@main | |
# Download the aritfacts produced in the preceeding jobs | |
- name: Download linux 20.04 | |
uses: actions/download-artifact@v3 | |
with: | |
name: bsp4bazel-linux-x86 | |
path: staging | |
- name: Download macos x86 | |
uses: actions/download-artifact@v3 | |
with: | |
name: bsp4bazel-macos-x86 | |
path: staging | |
# Update versions, and shas, in files | |
- name: Update versions, and shas | |
working-directory: "repo" | |
run: | | |
./.github/ci_scripts/update_all.sh ${{ inputs.version }} | |
# Push changes back to master | |
- name: Commit updates | |
working-directory: "repo" | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -a -m "Release ${{ inputs.version }}" | |
git tag -a -m "Release ${{ inputs.version }}" ${{ inputs.version }} | |
git push --atomic --follow-tags | |
- name: "Create release" | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ inputs.version }}" | |
prerelease: false | |
files: | | |
staging/bsp4bazel-linux-x86 | |
staging/bsp4bazel-linux-x86.sha256 | |
staging/bsp4bazel-macos-x86 | |
staging/bsp4bazel-macos-x86.sha256 | |
staging/bazel_rules.tar.gz | |
staging/bazel_rules.tar.gz.sha256 |