Skip to content

Commit

Permalink
Linux-only npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonRolev committed Oct 10, 2024
1 parent 4a616ef commit 30139c1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# WORK IN PROGRESS

# The idea was to have a main package that installs the other three packages as dependencies, maybe optionalDependencies, keeping the same version somehow.
# maybe a postinstall script that gets the current version of the main package and attempts to `npm install @mvr/lib-$OS@<main-version>`.

# This composite action Releases a different-named package with the same version as the main one
# Can modify any package.json params before releasing (name, os, files etc.)
# Checks out to a temporary branch, prepares the package and releases it directly (not following auto shipit defaults)

# Usage:
# - name: Release OS
# uses: ./libMvrGdtf/.github/actions/release-as
# env:
# GITHUB_TOKEN: ${{ secrets.NPM_PKG_KEY }}
# NODE_AUTH_TOKEN: ${{secrets.NPM_PKG_KEY}}

name: Release OS package
description: Release the package for a particular OS
runs:
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,8 @@ on:
workflow_dispatch:

jobs:
release-main-package:
release:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Shipit
env:
GITHUB_TOKEN: ${{ secrets.NPM_PKG_KEY }}
NODE_AUTH_TOKEN: ${{secrets.NPM_PKG_KEY}}
run: |
npm install
npm run release -- --dry-run
# Run as separate jobs, not separate matrix steps
release-os-sub-packages:
needs: release-main-package
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository under ./libMvrGdtf
uses: actions/checkout@v4
Expand All @@ -39,8 +17,11 @@ jobs:
- name: Build
uses: ./libMvrGdtf/.github/actions/build-lib

- name: Release OS
uses: ./libMvrGdtf/.github/actions/release-os
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.NPM_PKG_KEY }}
NODE_AUTH_TOKEN: ${{secrets.NPM_PKG_KEY}}
working-directory: libMvrGdtf
run: |
npm install
npm run release
12 changes: 0 additions & 12 deletions main.js

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"version": "9.0.11",
"name": "@mvrdevelopment/lib-mvr-gdtf",
"name": "@mvrdevelopment/lib-gdtf-linux",
"files": [
"main.js"
"output"
],
"os": ["linux"],
"author": "mvrdevelopment",
"publishConfig": {
"registry": "https://npm.pkg.github.com/mvrdevelopment"
Expand All @@ -13,8 +14,7 @@
},
"private": false,
"scripts": {
"release": "auto shipit --base-branch=master",
"postinstall": "bash ./install.sh"
"release": "auto shipit --base-branch=master"
},
"devDependencies": {
"auto": "^11.2.1"
Expand Down

0 comments on commit 30139c1

Please sign in to comment.