This repository has been archived by the owner on Sep 29, 2022. It is now read-only.
forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 2.18 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: 'Ionic Nightly Build'
on:
schedule:
# Run every Monday-Friday
# at 6:00 UTC (6:00 am UTC)
- cron: '00 06 * * 1-5'
jobs:
nightly-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 }}
- name: Configure Identity
run: |
git config user.name github-actions
git config user.email github-actions@github.com
# 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
# The date should output YYYYMMDD
# so that it is human readable
run: |
echo "DATE=$(date +%Y%m%d)" >> $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.DATE }}")
git push origin nightly-$(echo "${{ env.DATE }}")
shell: bash
- name: Create Nightly Build
run: |
HUSKY_SKIP_HOOKS=1 lerna publish $(echo "${{ env.CURRENT_VERSION }}")-nightly.$(echo "${{ env.DATE }}") --no-verify-access --yes --force-publish='*' --dist-tag nightly --conventional-commits --conventional-prerelease --exact --create-release github
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# We need to push the commit changes in order for the tags
# to get updated, but we don't need to keep the changelog
# changes around.
- name: Delete Nightly Branch
run: |
git checkout main
git branch -D nightly-$(echo "${{ env.DATE }}")
git push origin --delete nightly-$(echo "${{ env.DATE }}")
shell: bash