1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/.github/workflows/daily-alpha.yml
Janne Savolainen a0fb46c3e6
Switch to using NPM workspaces (#7115)
* Switch to using npm over yarn

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove reference to `yarn` from documentation

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Enable NPM workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Introduce script for installing all dependencies

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove usage of lerna bootstrap for no longer being used

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Fix build by not bundling libraries for application in node environment (main) as Electron does that

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Tweak evil static import paths in build of application

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Consolidate npmrc configs to root since required by workspaces

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make application build not fail for not detecting electron version

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Make sure native dependencies are rebuilt for electron

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Remove unused binary for causing trouble when installing dependencies

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Update package-lock

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

* Disable caching in CI for Windows

Installing Electron in Windows seems to be broken in this regards.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>

---------

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
2023-02-20 12:48:18 +02:00

103 lines
3.3 KiB
YAML

name: Release daily alpha
on:
schedule:
- cron: 0 0 30 * 1-5 # At 12:30am UTC work day
workflow_dispatch: # for testing
jobs:
tag:
outputs:
tagname: v${{ steps.version.outputs.VERSION }}
version: ${{ steps.version.outputs.VERSION }}
continue: ${{ steps.create-branch.outputs.CONTINUE }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://npm.pkg.github.com"
- name: Install deps
run: |
npm install
sudo apt-get install -y ripgrep
cd packages/bump-version-for-cron && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bump version
id: version
run: |
node packages/bump-version-for-cron/dist/index.js --path lerna.json
- name: Check if branch already exists
id: check-branch
run: git ls-remote --exit-code --tags origin v${{ steps.version.outputs.VERSION }}
continue-on-error: true
- name: Create branch and tag and push
id: create-branch
run: |
# failure means that the tag doesn't exist so we should create it
if [ ${{ steps.check-branch.outcome }} != 'failure' ]; then
echo "CONTINUE=false" >> "$GITHUB_OUTPUT"
exit 0
fi
git config --global user.email "bot@k8slens.dev"
git config --global user.name "k8slens bot"
git checkout -b release/v${{ steps.version.outputs.VERSION }}
git add .
git commit -sm "Release ${{ steps.version.outputs.VERSION }}"
git tag v${{ steps.version.outputs.VERSION }}
git push origin v${{ steps.version.outputs.VERSION }}
echo "CONTINUE=true" >> "$GITHUB_OUTPUT"
create_release:
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ needs.tag.outputs.version }}
needs: [tag]
if: ${{ needs.tag.outputs.continue == 'true' }}
runs-on: ubuntu-20.04
steps:
- name: Create GitHub release
uses: softprops/action-gh-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.tagname }}
name: ${{ needs.tag.outputs.tagname }}
generate_release_notes: true
prerelease: true
release_packages:
needs: [create_release]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: v${{ needs.create_release.outputs.version }}
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://npm.pkg.github.com"
- name: Build package
shell: bash
run: |
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release to GitHub NPM registry
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
npx lerna \
publish from-package \
--no-push \
--no-git-tag-version \
--yes \
--dist-tag cron
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}