2022-10-28 16:20:18 +00:00
name : Nightly builds
2023-02-22 06:57:58 +00:00
2022-10-28 16:20:18 +00:00
on :
schedule :
2023-10-31 12:12:55 +00:00
- cron : '1 0 * * *' # Run at 12:01 AM UTC.
2022-10-28 16:20:18 +00:00
workflow_dispatch :
2023-02-22 06:57:58 +00:00
2023-08-23 11:39:37 +00:00
env :
NODE_OPTIONS : --max-old-space-size=4096 # development build takes a lot of memory
2022-10-28 16:20:18 +00:00
jobs :
build :
name : Nightly builds
strategy :
fail-fast : false
matrix :
build : [ trunk]
runs-on : ubuntu-20.04
steps :
- name : Checkout Code
uses : actions/checkout@v3
with :
ref : ${{ matrix.build }}
2023-02-22 06:57:58 +00:00
- name : Install Node
2023-11-03 15:06:34 +00:00
uses : actions/setup-node@v4
2023-02-22 06:57:58 +00:00
with :
node-version-file : '.nvmrc'
2022-10-28 16:20:18 +00:00
- name : Install Node Dependencies
run : npm ci --no-optional
- name : Build zip
run : bash bin/build-plugin-zip.sh -d
- name : Deploy nightly build
2022-12-12 16:40:39 +00:00
uses : WebFreak001/deploy-nightly@v2.0.0
2022-10-28 16:20:18 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
# 80943895 is the release ID of this nightly release https://github.com/woocommerce/woocommerce-blocks/releases/tag/nightly
upload_url : https://uploads.github.com/repos/${{ github.repository }}/releases/80943895/assets{?name,label}
release_id : 80943895
asset_path : woocommerce-gutenberg-products-block.zip
asset_name : woocommerce-blocks-${{ matrix.build }}-nightly.zip
asset_content_type : application/zip
max_releases : 1
2023-10-31 12:12:55 +00:00
- name : Get Date
id : date
uses : lee-dohm/calculate-dates-and-times@v1.0.2
with :
format : 'YYYY-MM-DD'
subtract : '1 day'
- name : Update release notes
uses : irongut/EditRelease@v1.2.0
with :
token : ${{ secrets.GITHUB_TOKEN }}
id : 80943895
2023-11-01 11:25:46 +00:00
body : "Nightly release auto generated everyday at 12:01 AM UTC. \n\n[PRs merged since last nightly build](https://github.com/woocommerce/woocommerce-blocks/pulls?q=is%3Apr+closed%3A>%3D{{ steps.date.outputs.date }}+is%3Amerged)"
2023-10-31 12:12:55 +00:00
spacing : 0
replacebody : true
2022-10-28 16:20:18 +00:00
update :
name : Update nightly tag commit ref
runs-on : ubuntu-20.04
steps :
- name : Update nightly tag
2023-11-03 16:37:20 +00:00
uses : richardsimko/github-tag-action@v1.0.11
2022-10-28 16:20:18 +00:00
with :
tag_name : nightly
env :
2023-02-22 06:57:58 +00:00
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}