Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Unlock pinned version requirement for dependencies #649

Unlock pinned version requirement for dependencies

Unlock pinned version requirement for dependencies #649

Workflow file for this run

name: Deployment
on: push
jobs:
deploy_release:
name: "Deploy release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- run: yarn install --frozen-lockfile
- name: Building
run: yarn css:build
- name: Bundling assets
run: ./bundle.sh
- name: Release with tag
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: dist.zip
- name: Release branch
if: startsWith(github.ref, 'refs/heads/')
uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
# Add prefix branch name to avoid duplicate git references.
automatic_release_tag: "release-${{ github.ref_name }}"
prerelease: true
title: ${{ github.ref_name }}
files: dist.zip
deploy_npm:
name: "Deploy NPM package"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: "https://npm.pkg.github.com"
scope: "@${{ github.repository_owner }}"
- run: yarn install --frozen-lockfile
- name: Building
run: yarn css:build
- name: Bundling assets
run: ./bundle.sh
- name: Modify package.json for local context
# Values in package.json must match the current GitHub repository to
# publish to it.
run: |
npm exec -- json -I -f package.json -e "this.name='@$GITHUB_REPOSITORY'"
npm exec -- json -I -f package.json -e "this.repository='https://github.com/$GITHUB_REPOSITORY'"
- name: Release branch
if: startsWith(github.ref, 'refs/heads/')
# Version 0.0.0-SHA is a schema that supports semantic versioning but
# should sink below proper versions.
# Output package.json to provide insight and help debugging
# Using branch names as tags allows other projects to track unreleased
# development.
run: |
NPM_TAG_NAME=$(echo $GITHUB_REF_NAME | tr -d [:space:] | tr -C [:alnum:] -)
npm version 0.0.0-$GITHUB_SHA --no-git-tag-version
echo $NPM_TAG_NAME
cat package.json
npm publish --tag $NPM_TAG_NAME
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release with tag
if: startsWith(github.ref, 'refs/tags/')
# The latest tag follows tagged versions to follow NPM conventions.
run: |
npm version $GITHUB_REF_NAME --no-git-tag-version
cat package.json
npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}