Skip to content

Commit

Permalink
Fix issue with Scala test. Split up release
Browse files Browse the repository at this point in the history
[node_publish]
  • Loading branch information
shanedell committed May 18, 2022
1 parent 4f9741a commit 1d235e9
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 24 deletions.
94 changes: 71 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,47 @@ env:
echo "PKG_VERSION=$PKG_VERSION" >> $GITHUB_ENV
jobs:
create-release:
name: Create Release ✨
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Export git tag and package.json version 🚢
run: ${{ env.export_cmd }}

- name: Check if pre-release ✅
run: |
if [[ ${{ env.GIT_TAG }} == *"pre-"* || ${{ env.GIT_TAG }} == *"-pre"* ]]; then
echo "PRE_RELEASE=true" >> $GITHUB_ENV
else
echo "PRE_RELEASE=false" >> $GITHUB_ENV
fi
shell: bash

- name: Create release 🔧
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: "${{ env.PRE_RELEASE }}"

- name: Create upload_url file 🔧
run: echo "${{ steps.create_release.outputs.upload_url }}" > upload_url

- name: Upload upload_url 🔺
uses: actions/upload-artifact@v2
with:
name: upload_url
path: upload_url

node-build:
name: Build ubuntu-latest 🔧
runs-on: ubuntu-latest
needs: [create-release]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -56,6 +94,7 @@ jobs:
os: [macos-latest, windows-latest]
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: [create-release]
steps:
- name: Enable Developer Command Prompt 💻
if: runner.os == 'Windows'
Expand Down Expand Up @@ -237,34 +276,24 @@ jobs:
path: src/rpc/server/scala/${{ matrix.os }}-server
if-no-files-found: error

release:
name: Release ✨
node-release:
name: Node Release ✨
runs-on: ubuntu-latest
needs: [node-build, server-packaging]
needs: [node-build]
steps:
- uses: actions/checkout@v2
- name: Export git tag and package.json version 🚢
run: ${{ env.export_cmd }}

- name: Check if pre-release ✅
run: |
if [[ ${{ env.GIT_TAG }} == *"pre-"* || ${{ env.GIT_TAG }} == *"-pre"* ]]; then
echo "PRE_RELEASE=true" >> $GITHUB_ENV
else
echo "PRE_RELEASE=false" >> $GITHUB_ENV
fi
shell: bash

- name: Create release 🔧
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download upload_url
uses: actions/download-artifact@v2
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: "${{ env.PRE_RELEASE }}"
name: upload_url

- name: Add upload_url to GITHUB_ENV
run: |
UPLOAD_URL=$(cat upload_url)
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV
##########################
## Node release process ##
Expand Down Expand Up @@ -292,7 +321,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./omega-edit-v${{ env.PKG_VERSION }}.tar.gz
asset_name: omega-edit-grpc-node-client-${{ env.PKG_VERSION }}.tar.gz
asset_content_type: application/tar+gzip
Expand All @@ -306,6 +335,25 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ contains(github.event.head_commit.message, '[node_publish]') }}

scala-release:
name: Scala Release ✨
runs-on: ubuntu-latest
needs: [server-packaging]
steps:
- uses: actions/checkout@v2
- name: Export git tag and package.json version 🚢
run: ${{ env.export_cmd }}

- name: Download upload_url
uses: actions/download-artifact@v2
with:
name: upload_url

- name: Add upload_url to GITHUB_ENV
run: |
UPLOAD_URL=$(cat upload_url)
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV
###########################
## Scala release process ##
###########################
Expand Down Expand Up @@ -346,7 +394,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./omega-edit-scala-server-${{ env.PKG_VERSION }}.zip
asset_name: omega-edit-scala-server-${{ env.PKG_VERSION }}.zip
asset_content_type: application/tar+gzip
11 changes: 11 additions & 0 deletions project/Rat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@ object Rat {
file("src/rpc/client/ts/tests/package.json"),
file("src/rpc/client/ts/tests/package-lock.json"),
file("src/rpc/client/ts/tests/tsconfig.json"),
file("src/rpc/client/ts/.prettierrc"),
// compiles files
file(".devcontainer/devcontainer.json"),
file("src/rpc/client/ts/src/omega_edit_pb.js"),
file("src/rpc/client/ts/out/settings.js.map"),
file("src/rpc/client/ts/out/omega_edit_pb.js"),
file("src/rpc/client/ts/out/change.js.map"),
file("src/rpc/client/ts/out/viewport.js.map"),
file("src/rpc/client/ts/out/version.js.map"),
file("src/rpc/client/ts/src/omega_edit_pb.d.ts"),
file("src/rpc/client/ts/out/session.js.map"),
file("src/rpc/client/ts/src/omega_edit_grpc_pb.d.ts"),
// cmake build folder
file("cmake-build-debug"),
file("cmake-build-release"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class Session(
offset,
request.length.getOrElse(0),
session.search(
request.pattern,
request.pattern.toString,
offset,
request.length,
isCaseInsensitive,
Expand Down

0 comments on commit 1d235e9

Please sign in to comment.