-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1.35 KB
/
sync-themes-branch-target-release.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
name: Publish to target tag based off of branch name
on:
push:
branches:
# only run on branch names that match:
# arc-themes-release-{numbers}.{numbers} per product
- arc-themes-release-[0-9]+\.[0-9]+
# only run on changes to these files
paths:
- '**.js'
jobs:
publish:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
SYNCED_RELEASE_TAG: ${{ github.ref_name }} # targets branch name ref_name
steps:
- name: Set git username
run: git config --global user.email "[email protected]" && git config --global user.name "Jack Howard"
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.NODE_AUTH_TOKEN }}
# pulls all tags (needed for lerna / semantic release to correctly version)
- name: Pull tags to give lerna access to git info
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Configure NPM
run: |
echo "//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN" > .npmrc
echo '@wpmedia:registry=https://npm.pkg.github.com' >> .npmrc
- name: Publish to target tag based off of branch name
run: npx lerna publish --dist-tag ${{ env.SYNCED_RELEASE_TAG }} --canary --preid ${{ env.SYNCED_RELEASE_TAG }} -y