From df10f283f2661f88d71fcecc7294570fa3e9c809 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 14 Apr 2022 19:04:52 +0000 Subject: [PATCH] ci(nightly): add script for generating nightly builds of ionic --- .github/workflows/nightly.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..7601fa2a59 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,45 @@ +name: 'Ionic Nightly Build' + +on: + workflow_dispatch: + + # TODO remove this before merging + # This is so we can test in the PR + pull_request: + branches: [ '**' ] + +jobs: + dev-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - name: Install Dependencies + run: npm ci --no-package-lock && lerna bootstrap --ignore-scripts -- --legacy-peer-deps + shell: bash + - name: Prepare NPM Token + run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc + shell: bash + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + # A 1 is required before the timestamp + # as lerna will fail when there is a leading 0 + # See https://github.com/lerna/lerna/issues/2840 + - name: Create Nightly Hash + run: | + echo "HASH=1$(git log -1 --format=%H | cut -c 1-7)" >> $GITHUB_ENV + echo "TIMESTAMP=1$(date +%s)" >> $GITHUB_ENV + echo "CURRENT_VERSION=$(node ./.scripts/bump-version.js)" >> $GITHUB_ENV + shell: bash + - name: Checkout Nightly Branch + run: | + git checkout -b nightly-$(echo "${{ env.TIMESTAMP }}")-$(echo "${{ env.HASH }}") + shell: bash + - name: Create Nightly Build + run: | + HUSKY_SKIP_HOOKS=1 lerna publish $(echo "${{ env.CURRENT_VERSION }}")-nightly.$(echo "${{ env.TIMESTAMP }}").$(echo "${{ env.HASH }}") --canary --no-verify-access --yes --force-publish='*' --dist-tag nightly --conventional-commits --conventional-prerelease --exact --create-release github + shell: bash