Skip to content

Make FunctionMap allow arbitrary amount of parameters #8

Make FunctionMap allow arbitrary amount of parameters

Make FunctionMap allow arbitrary amount of parameters #8

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
uses: ./.github/workflows/build.yaml
secrets: inherit
publish:
name: Publish to npmjs.org
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .npmrc
run: cp tools/_.npmrc .npmrc
- uses: actions/download-artifact@v3
with:
name: dist.tar
- name: Unpack compilation artifact
run: mkdir dist && tar -xf dist.tar -C dist
- name: Configure the package.json for publishing
run: jq --arg version "${REF#refs\/tags\/v}" 'del(.devDependencies,.scripts,.private) | .version=$version' package.json > dist/package.json
env:
REF: ${{ github.ref }}
- name: Include README.md in the package
run: cp README.md dist/
- name: Publish the package
uses: docker://node:14.18.2-alpine3.14
with:
args: yarn --cwd dist publish --no-git-tag-version
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_RW }}
- name: Update compilation artifact
run: tar -cf ../dist.tar *
working-directory: dist
- uses: actions/upload-artifact@v3
with:
name: dist.tar
path: dist.tar
retention-days: 1
create-release:
name: Create GitHub Release
needs: [publish]
runs-on: ubuntu-latest
steps:
- name: Determine version
id: version
run: printf "tag=%s\n" "${REF#refs\/tags\/}" >> $GITHUB_OUTPUT
env:
REF: ${{ github.ref }}
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ steps.version.outputs.tag }}
- name: Get release notes from tag
id: tag-message
run: |
MESSAGE=$(git tag -l --format='%(contents)' "${REF#refs\/tags\/}")
MESSAGE=${MESSAGE//'%'/'%25'}
MESSAGE=${MESSAGE//$'\n'/'%0A'}
MESSAGE=${MESSAGE//$'\r'/'%0D'}
printf "message=%s\n" "$MESSAGE" >> $GITHUB_OUTPUT
env:
REF: ${{ github.ref }}
- uses: actions/download-artifact@v3
with:
name: dist.tar
- name: Compress release artifact
run: gzip dist.tar && mv dist.tar.gz ${{ steps.version.outputs.tag }}.tar.gz
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version.outputs.tag }}
body: ${{ steps.tag-message.outputs.message }}
draft: false
prerelease: false
artifacts: ${{ steps.version.outputs.tag }}.tar.gz
artifactErrorsFailBuild: true
artifactContentType: application/gzip