Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
dca841b9
Unverified
Commit
dca841b9
authored
Apr 22, 2021
by
Michael Kriese
Committed by
GitHub
Apr 22, 2021
Browse files
Options
Downloads
Patches
Plain Diff
build: release workflow update (#9677)
parent
3516c705
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/build.yml
+20
-3
20 additions, 3 deletions
.github/workflows/build.yml
.github/workflows/release-npm.yml
+30
-7
30 additions, 7 deletions
.github/workflows/release-npm.yml
with
50 additions
and
10 deletions
.github/workflows/build.yml
+
20
−
3
View file @
dca841b9
...
@@ -7,12 +7,19 @@ on:
...
@@ -7,12 +7,19 @@ on:
-
v24
-
v24
workflow_dispatch
:
workflow_dispatch
:
inputs
:
dryRun
:
description
:
'
Dry-Run'
default
:
'
true'
env
:
env
:
# Currently no way to detect automatically (#8153)
DEFAULT_BRANCH
:
master
YARN_MODULES_CACHE_KEY
:
v1
YARN_MODULES_CACHE_KEY
:
v1
YARN_PACKAGE_CACHE_KEY
:
v1
YARN_PACKAGE_CACHE_KEY
:
v1
YARN_CACHE_FOLDER
:
.cache/yarn
YARN_CACHE_FOLDER
:
.cache/yarn
NODE_VERSION
:
14
NODE_VERSION
:
14
DRY_RUN
:
true
jobs
:
jobs
:
test
:
test
:
...
@@ -98,7 +105,8 @@ jobs:
...
@@ -98,7 +105,8 @@ jobs:
uses
:
codecov/codecov-action@v1.4.1
uses
:
codecov/codecov-action@v1.4.1
if
:
always() && env.coverage == 'true'
if
:
always() && env.coverage == 'true'
# build after tests to exclude files
# build after tests to exclude build files from tests
# TODO: check if build before test speeds up tests
-
name
:
Build
-
name
:
Build
run
:
yarn build
run
:
yarn build
...
@@ -179,6 +187,16 @@ jobs:
...
@@ -179,6 +187,16 @@ jobs:
yarn config set version-git-tag false
yarn config set version-git-tag false
npm config set scripts-prepend-node-path true
npm config set scripts-prepend-node-path true
-
name
:
Check dry run
run
:
|
if [[ "${{github.event_name}}" == "workflow_dispatch" && "${{ github.event.inputs.dryRun }}" != "true" ]]; then
echo "DRY_RUN=false" >> $GITHUB_ENV
elif [[ "${{github.ref}}" == "refs/heads/${{env.DEFAULT_BRANCH}}" ]]; then
echo "DRY_RUN=false" >> $GITHUB_ENV
elif [[ "${{github.ref}}" =~ ^refs/heads/v[0-9]+(\.[0-9]+)?$ ]]; then
echo "DRY_RUN=false" >> $GITHUB_ENV
fi
# full checkout for semantic-release
# full checkout for semantic-release
-
uses
:
actions/checkout@v2.3.4
-
uses
:
actions/checkout@v2.3.4
with
:
with
:
...
@@ -194,10 +212,9 @@ jobs:
...
@@ -194,10 +212,9 @@ jobs:
run
:
yarn install --frozen-lockfile
run
:
yarn install --frozen-lockfile
-
name
:
semantic-release
-
name
:
semantic-release
if
:
github.ref == 'refs/heads/master'
run
:
|
run
:
|
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
npx semantic-release --dry-run ${{
github.ref != 'refs/heads/master'}} --ci ${{github.ref == 'refs/heads/master'
}}
npx semantic-release --dry-run ${{
env.DRY_RUN
}}
env
:
env
:
GITHUB_TOKEN
:
${{ secrets.GH_TOKEN }}
GITHUB_TOKEN
:
${{ secrets.GH_TOKEN }}
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
This diff is collapsed.
Click to expand it.
.github/workflows/release-npm.yml
+
30
−
7
View file @
dca841b9
name
:
release-npm
name
:
release-npm
on
:
on
:
repository_dispatch
:
repository_dispatch
:
types
:
[
renovate-release
]
types
:
[
renovate-release
]
workflow_dispatch
:
inputs
:
sha
:
description
:
'
Git
sha
to
checkout'
required
:
true
version
:
description
:
'
Version
to
release'
required
:
true
tag
:
description
:
'
Npm
dist-tag'
default
:
'
latest'
env
:
env
:
YARN_MODULES_CACHE_KEY
:
v1
YARN_MODULES_CACHE_KEY
:
v1
YARN_PACKAGE_CACHE_KEY
:
v1
YARN_PACKAGE_CACHE_KEY
:
v1
YARN_CACHE_FOLDER
:
.cache/yarn
YARN_CACHE_FOLDER
:
.cache/yarn
NODE_VERSION
:
14
NODE_VERSION
:
14
GIT_SHA
:
${{ github.event.client_payload.sha }}
NPM_VERSION
:
${{ github.event.client_payload.version }}
NPM_TAG
:
${{ github.event.client_payload.tag }}
jobs
:
jobs
:
release-npm
:
release-npm
:
...
@@ -27,9 +43,17 @@ jobs:
...
@@ -27,9 +43,17 @@ jobs:
yarn config set version-git-tag false
yarn config set version-git-tag false
npm config set scripts-prepend-node-path true
npm config set scripts-prepend-node-path true
-
name
:
Prepare env
run
:
|
if [[ "${{github.event_name}}" == "workflow_dispatch" ]]; then
echo "GIT_SHA=${{ github.event.inputs.sha }}" >> $GITHUB_ENV
echo "NPM_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "NPM_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
fi
-
uses
:
actions/checkout@v2.3.4
-
uses
:
actions/checkout@v2.3.4
with
:
with
:
ref
:
${{
github.event.client_payload.sha
}}
ref
:
${{
env.GIT_SHA
}}
-
name
:
Cache Yarn packages
-
name
:
Cache Yarn packages
id
:
yarn_cache_packages
id
:
yarn_cache_packages
...
@@ -41,17 +65,16 @@ jobs:
...
@@ -41,17 +65,16 @@ jobs:
-
name
:
Installing dependencies
-
name
:
Installing dependencies
run
:
yarn install --frozen-lockfile
run
:
yarn install --frozen-lockfile
-
name
:
Build ${{
github.event.client_payload.version
}}
-
name
:
Build ${{
env.NPM_VERSION
}}
run
:
yarn build
run
:
yarn build
-
name
:
Prepare ${{
github.event.client_payload.version
}}
-
name
:
Prepare
${{
env.NPM_VERSION
}}
run
:
|
run
:
|
npm --no-git-tag-version version ${{
github.event.client_payload.version
}}
npm --no-git-tag-version version ${{
env.NPM_VERSION
}}
-
name
:
Publish ${{
github.event.client_payload.version
}}
-
name
:
Publish ${{
env.NPM_VERSION
}}
run
:
|
run
:
|
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' >> ~/.npmrc
npm publish --tag ${TAG:-latest}
npm publish --tag ${
NPM_
TAG:-latest}
env
:
env
:
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
TAG
:
${{ github.event.client_payload.tag }}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment