Skip to content

DRYRUN.2023-11-24.09.08.41 #332

DRYRUN.2023-11-24.09.08.41

DRYRUN.2023-11-24.09.08.41 #332

Workflow file for this run

name: publish
env:
NODE_VERSION: 18.x
NPM_REGISTRY: 'https://registry.npmjs.org'
on:
push:
tags:
- v*
- DRYRUN*
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
action: ${{ steps.action.outputs.type }}
steps:
- name: Get Tag Name
uses: olegtarasov/[email protected]
id: tagName
- id: action
name: Determine Action Type
shell: bash
run: |
if [[ ${{ contains(steps.tagName.outputs.tag, 'DRYRUN') }} == true ]]
then
echo type=dryrun
echo "type=dryrun" >> "$GITHUB_OUTPUT"
else
echo type=publish
echo "type=publish" >> "$GITHUB_OUTPUT"
fi
macos-builds:
name: Builds (macOS)
needs: [setup]
strategy:
matrix:
target: [darwin-arm64, darwin-x64]
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
shell: bash
run: npm ci
- name: Bump Version (dry-run only)
if: ${{ needs.setup.outputs.action == 'dryrun' }}
shell: bash
run: |
git checkout main
git config --global user.email '[email protected]'
git config --global user.name 'Neon CI'
git branch -a
npm version patch -m 'dryrun'
git branch -a
git status
- name: Build
uses: neon-actions/[email protected]
with:
working-directory: ./pkgs/cargo-messages
input-directory: npm/${{ matrix.target }}
node-version: ${{ env.NODE_VERSION }}
npm-publish: false
github-release: ${{ needs.setup.outputs.action == 'publish' }}
windows-builds:
name: Builds (Windows)
needs: [setup]
strategy:
matrix:
target: [win32-x64-msvc, win32-arm64-msvc]
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
shell: bash
run: npm ci
- name: Bump Version (dry-run only)
if: ${{ needs.setup.outputs.action == 'dryrun' }}
shell: bash
run: |
git checkout main
git config --global user.email '[email protected]'
git config --global user.name 'Neon CI'
git branch -a
npm version patch -m 'dryrun'
git branch -a
git status
- name: Build
uses: neon-actions/[email protected]
with:
working-directory: ./pkgs/cargo-messages
input-directory: npm/${{ matrix.target }}
node-version: ${{ env.NODE_VERSION }}
npm-publish: false
github-release: ${{ needs.setup.outputs.action == 'publish' }}
other-builds:
name: Builds (other platforms)
needs: [setup]
strategy:
matrix:
target: [linux-arm-gnueabihf, linux-x64-gnu, android-arm-eabi]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
shell: bash
run: npm ci
- name: Bump Version (dry-run only)
if: ${{ needs.setup.outputs.action == 'dryrun' }}
shell: bash
run: |
git checkout main
git config --global user.email '[email protected]'
git config --global user.name 'Neon CI'
git branch -a
npm version patch -m 'dryrun'
git branch -a
git status
- name: Build
uses: neon-actions/[email protected]
with:
working-directory: ./pkgs/cargo-messages
input-directory: npm/${{ matrix.target }}
node-version: ${{ env.NODE_VERSION }}
use-cross: true
npm-publish: false
github-release: ${{ needs.setup.outputs.action == 'publish' }}
publish:
name: Publish
needs: [setup, macos-builds, windows-builds, other-builds]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Dependencies
shell: bash
run: npm ci
- name: Publish (cargo-messages)
if: ${{ needs.setup.outputs.action == 'publish' }}
uses: neon-actions/[email protected]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
working-directory: ./pkgs/cargo-messages
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ env.NPM_REGISTRY }}
fetch-binaries: "*.tgz"
github-release: true
- name: Build (@neon-rs/load)
shell: bash
run: npm run build
working-directory: ./pkgs/load
- name: Publish (@neon-rs/load)
if: ${{ needs.setup.outputs.action == 'publish' }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
working-directory: ./pkgs/load
- name: Update (@neon-rs/cli)
if: ${{ needs.setup.outputs.action == 'publish' }}
shell: bash
run: |
git checkout main
git config --global user.email '[email protected]'
git config --global user.name 'Neon CI'
npm run update-src
git commit -a -m 'update cli to cargo-messages@latest'
git push
- name: Publish (@neon-rs/cli)
if: ${{ needs.setup.outputs.action == 'publish' }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access public
working-directory: ./pkgs/cli