Skip to content

Merge pull request #16 from farm-fe/feat/pkg-publish #16

Merge pull request #16 from farm-fe/feat/pkg-publish

Merge pull request #16 from farm-fe/feat/pkg-publish #16

Workflow file for this run

name: Publish packages and crates
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
call-rust-build:
uses: ./.github/workflows/build.yaml
release:
name: Release
needs: [call-rust-build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
# batch download artifacts
- uses: actions/download-artifact@v3
with:
path: /tmp/artifacts
- name: Move Artifacts
run: |
for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
do
mv /tmp/artifacts/${{ github.sha }}-${abi}-farm-plugin-dsv/* ./packages/farm-plugin-dsv/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-farm-plugin-react-components/* ./packages/farm-plugin-react-components/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-farm-plugin-virtual/* ./packages/farm-plugin-virtual/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-farm-plugin-yml/* ./packages/farm-plugin-yml/npm/${abi}
mv /tmp/artifacts/${{ github.sha }}-${abi}-farm-plugin-strip/* ./packages/farm-plugin-strip/npm/${abi}
test -f ./packages/farm-plugin-react-components/npm/${abi}/index.farm
test -f ./packages/farm-plugin-virtual/npm/${abi}/index.farm
test -f ./packages/farm-plugin-yml/npm/${abi}/index.farm
test -f ./packages/farm-plugin-strip/npm/${abi}/index.farm
done
- name: Install Dependencies
run: npm install -g [email protected] && pnpm i --frozen-lockfile
- name: Publish to npm
run: npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} && pnpm publish --recursive --no-git-checks