Skip to content

Commit

Permalink
Merge pull request #620 from nfdi4plants/gh-action-test-branch
Browse files Browse the repository at this point in the history
Add more CI/CD for releases
  • Loading branch information
Freymaurer authored Feb 5, 2025
2 parents 2576a92 + 0087898 commit 2dc1b5a
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 56 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/PublishNpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- name: Extract Latest Tag as Version
id: get_version
run: echo "PACKAGE_VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV
run: echo "GIT_TAG_LATEST=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> "$GITHUB_ENV"

- name: Install Node.js
uses: actions/setup-node@v4
Expand All @@ -35,19 +35,31 @@ jobs:
- name: Restore .NET dependencies
run: dotnet tool restore

- name: Install root NPM Dependencies
run: npm install

- name: Install NPM Dependencies
run: npm install
working-directory: src/Components

- name: Set Package Version
run: npm version --no-git-tag-version $PACKAGE_VERSION
working-directory: src/Componentes
run: npm version --no-git-tag-version $GIT_TAG_LATEST
working-directory: src/Components

- name: Build Package
run: npm run build
working-directory: src/Componentes
# - name: Publish to NPM
# run: npm publish --access public
# working-directory: src/Components
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
working-directory: src/Components

- name: Publish to NPM (Latest)
if: github.ref_name == 'release'
run: echo "non prerelase not configured for npm release."
working-directory: src/Components
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}

- name: Publish to NPM (Next)
if: github.ref_name == 'nightly' || github.ref_name == 'gh-action-test-branch'
run: npm publish --access public --tag next
working-directory: src/Components
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
17 changes: 11 additions & 6 deletions .github/workflows/PublishNuget.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Nightly NuGet Package
name: Publish NuGet Package

on:
push:
Expand All @@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure all tags are fetched

- name: Install .NET SDK
uses: actions/setup-dotnet@v4
Expand All @@ -20,7 +22,10 @@ jobs:

- name: Extract Latest Tag as Version
id: get_version
run: echo "PACKAGE_VERSION=$(git describe --tags --always --dirty)" >> $GITHUB_ENV
run: echo "GIT_TAG_LATEST=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> "$GITHUB_ENV"

- name: Debug GIT_TAG_LATEST
run: echo "Version extracted; $GIT_TAG_LATEST"

- name: Restore Dependencies
run: dotnet restore src/Components/src/Components.fsproj
Expand All @@ -34,10 +39,10 @@ jobs:
working-directory: src/Components

- name: Build Project
run: dotnet build src/Components/src/Components.fsproj --configuration Release /p:PackageVersion=${PACKAGE_VERSION}
run: dotnet build src/Components/src/Components.fsproj --configuration Release /p:GitTag=$GIT_TAG_LATEST

- name: Pack NuGet Package
run: dotnet pack src/Components/src/Components.fsproj --configuration Release --output nupkgs /p:PackageVersion=${PACKAGE_VERSION}
run: dotnet pack src/Components/src/Components.fsproj --configuration Release --output nupkgs /p:GitTag=$GIT_TAG_LATEST

# - name: Publish to NuGet
# run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish to NuGet
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
22 changes: 11 additions & 11 deletions .github/workflows/PublishStorybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ name: Build and Publish Storybook to GitHub Pages
on:
# Event for the workflow to run on
push:
branches:
- 'nightly' # Replace with the branch you want to deploy from
branches: ['nightly']
workflow_dispatch: # Allows manual runs from the Actions tab

permissions:
Expand Down Expand Up @@ -47,12 +46,13 @@ jobs:

# Build the project
- name: Build
run: npm run build:storybook # this does not work currently, as it does not move the transpiled files from Shared to storybook-static

# #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
# - uses: bitovi/[email protected]
# with:
# install_command: echo "install skipped" # default: npm ci
# build_command: echo "build skipped" # default: npm run build-storybook
# path: src/Components/storybook-static # default: dist/storybook
# checkout: false # default: true
run: npm run build:storybook
working-directory: src/Components

#👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
- uses: bitovi/[email protected]
with:
install_command: echo "install skipped" # default: npm ci
build_command: echo "build skipped" # default: npm run build-storybook
path: src/Components/storybook-static # default: dist/storybook
checkout: false # default: true
63 changes: 35 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,54 @@

> **Swate** - something or someone that gets you absolutely joyed ([Urban dictionary](https://www.urbandictionary.com/define.php?term=swate))
**Swate** is a **S**wate **w**orkflow **a**nnotation **t**ool for **e**xcel.

Swate aims to provide a low-friction workflow annotation experience that makes the usage of controlled vocabularies (ontologies) as easy and intuitive as possible. It is designed to integrate in the familiar spreadsheet environment that is the center of a great deal of data-focused wetlab work.
![Swate Logo](https://raw.githubusercontent.com/nfdi4plants/Branding/refs/heads/master/logos/Swate/Swate_logo_bg_transparent.svg)

![image](https://user-images.githubusercontent.com/39732517/135290851-cacd8626-2cc3-4c58-a343-c5ad037e3c5c.png)
Swate is a powerful web tool designed for research data management, providing versatile features across multiple platforms. Whether you're working in the browser, VS Code, Electron, or Excel, Swate enhances your data management workflow with a seamless experience.

### Available Platforms:
- **Web Tool**: [swate-alpha.nfdi4plants.org](https://swate-alpha.nfdi4plants.org)
- **VS Code Plugin**: [arc-vs-code](https://github.com/nfdi4plants/arc-vs-code)
- **Electron App**: [ARCitect](https://github.com/nfdi4plants/ARCitect)
- **Excel Add-In**: [ARC Excel Add-In](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/guides/annotate-in-excel/)

<!-- TOC -->
## Table of contents
### Features:
- Seamless integration across multiple platforms
- Rich set of tools for managing and annotating research data
- **React Components** released as npm package `@nfdi4plants/swate-components`
- **Fable NuGet package** `Swate.Components` for .NET developers
- **Storybook** available for component previews

- [Docs](#docs)
<!-- - [Install/Use](#installuse) -->
- [Contact](#contact)
### 🚀 Getting Started

<!-- /TOC -->
To get started with Swate, choose your preferred platform:

## Docs
1. **Web Tool**: Visit [swate-alpha.nfdi4plants.org](https://swate-alpha.nfdi4plants.org)
2. **VS Code Plugin**: Find installation instructions in the [knowledgebase](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/guides/vs-code-extension/)
3. **Electron App**: Download and install the app from the [GitHub Releases Page](https://github.com/nfdi4plants/ARCitect/releases)
4. **Excel Add-In**: Find installation instructions in the [knowledgebase](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/guides/annotate-in-excel/)

- Ontology term search
- ISA conform output
- Minimal information standards
### 🛠 Installation for Developers

Try our [quickstart](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/docs/guides/swate_QuickStart.html) or a more in-depth [walkthrough](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/docs/guides/swate_walkthrough.html).
#### React Components

For a full in-depth view of all Swate features check the [documentation](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/docs/SwateManual/index.html).
- **JavaScript**:
Install via npm:
```bash
npm install @nfdi4plants/swate-components
```

<!--
## Install/Use
- **Fable F#**:
Install via NuGet:
```bash
dotnet add package Swate.Components
```

[Swate installation](https://nfdi4plants.github.io/nfdi4plants.knowledgebase/docs/SwateManual/Docs01-Installing-Swate.html)
-->
### 📖 Storybook Preview

## Contact
See all available components in action by visiting our [Storybook](https://nfdi4plants.github.io/Swate/).

If you have any issues using Swate, missing features or found a nasty bug :bug: you can always contact us via:

- [GitHub Issues](https://github.com/nfdi4plants/Swate/issues)
- [DataPLANT Helpdesk](https://support.nfdi4plants.org/?topic=Tools_Swate)


## Contributing
### 🌱 Contributing

> [!IMPORTANT]
> A quote i found years ago by @Thorium.
Expand All @@ -55,4 +62,4 @@ If you have any issues using Swate, missing features or found a nasty bug :bug:
>
> Any help is welcome, from a typo fix to a new feature. If you are unsure about anything, just ask. We are here to help you help us.
If you want to contribute or just check out Swate on your local machine have a look at the [CONTRIBUTING.md](CONTRIBUTING.md) file.
If you want to contribute or just check out Swate on your local machine have a look at the [CONTRIBUTING.md](CONTRIBUTING.md) file.
2 changes: 1 addition & 1 deletion src/Components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
#### NPM

1. Update version in `./package.json`.
2. `npm run bundle` (transpiles with fable, creates tsc typed from jsdocs, and bundles with rollup)
2. `npm run bundle` (transpiles with fable, creates tsc types, and bundles with rollup)
3. `npm publish [--tag next]` (Use `--tag next` for prerelease)
112 changes: 112 additions & 0 deletions src/Components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@
"@storybook/react": "^8.6.0-alpha.0",
"@storybook/react-vite": "^8.6.0-alpha.0",
"@storybook/test": "^8.6.0-alpha.0",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/typography": "^0.5.16",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/browser": "^2.1.5",
"@vitest/coverage-v8": "^2.1.8",
"autoprefixer": "^10.4.19",
"daisyui": "^4.12.23",
"globals": "^15.14.0",
"playwright": "^1.49.1",
"postcss": "^8.4.39",
Expand Down
Loading

0 comments on commit 2dc1b5a

Please sign in to comment.