Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jura committed Oct 29, 2023
2 parents 42a69d0 + 2663d1c commit 57ff081
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish-assets-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish assets package

# Controls when the workflow will run
on:
release:
types: [released]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Extract current package version
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
# create package.json with updated version
- name: Create package.json for assets package
run: |
echo "{\"name\": \"@undp/design-system-assets\", \"version\": \"${{ steps.package-version.outputs.current-version}}\"}" > docs/package.json
# Preserve NPM publishing workflow
- name: get workflow definition
run: |
mkdir -p docs/.github/workflows
curl --location --request GET "https://raw.githubusercontent.com/undp/design-system-assets/main/.github/workflows/release-package.yml" -o docs/.github/workflows/release-package.yml
# Exclude Github workflow definitions from NPM package
- name: Create .npmignore file
run: |
echo ".github" > docs/.npmignore
# Push assets to their own repo
- name: Push files to @undp/design-system-assets repo
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source-directory: 'docs/'
destination-github-username: 'undp'
destination-repository-name: 'design-system-assets'
user-email: '[email protected]'

0 comments on commit 57ff081

Please sign in to comment.