Skip to content

Commit

Permalink
Merge pull request #9 from animo/chore/prepare-for-migration
Browse files Browse the repository at this point in the history
chore: prepare for migration
  • Loading branch information
TimoGlastra authored Jan 9, 2025
2 parents bcbcf4b + fb3ab75 commit 546a1c7
Show file tree
Hide file tree
Showing 18 changed files with 1,989 additions and 359 deletions.
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"privatePackages": false,
"fixed": [["@openid-federation/*"]],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"snapshot": {
"useCalculatedVersion": true
}
}
5 changes: 5 additions & 0 deletions .changeset/kind-wolves-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openid-federation/core": patch
---

chore: prepare for release at openwallet foundation
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Continuous Integration

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
validate:
runs-on: ubuntu-20.04
name: Validate
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Check Style
run: pnpm style:check

- name: Check Types
run: pnpm types:check

- name: Compile
run: pnpm build

tests:
runs-on: ubuntu-20.04
name: Tests

strategy:
fail-fast: false
matrix:
node-version: [18, 20]

steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

# See https://github.com/actions/setup-node/issues/641#issuecomment-1358859686
- name: pnpm cache path
id: pnpm-cache-path
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-node.outputs.node-version }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm test
93 changes: 0 additions & 93 deletions .github/workflows/pipeline.yaml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release-stable:
runs-on: ubuntu-20.04
name: Release Stable
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
title: "chore(release): new version"
commit: "chore(release): new version"
publish: pnpm release
version: pnpm changeset-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Get current package version
id: get_version
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")" >> $GITHUB_ENV

- name: Create Github Release
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}

release-unstable:
runs-on: ubuntu-20.04
name: Release Unstable
if: "always() && github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version')"
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Creating .npmrc
run: |
cat << EOF > ".npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create unstable release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# this ensures there's always a patch release created
cat << 'EOF' > .changeset/snapshot-template-changeset.md
---
'@openid-federation/core': patch
---
snapshot release
EOF
pnpm changeset version --snapshot alpha
pnpm style:fix
pnpm build
pnpm changeset publish --tag alpha
CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/core/package.json').version")
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag v$CURRENT_PACKAGE_VERSION
git push origin v$CURRENT_PACKAGE_VERSION --no-verify
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/node_modules
.DS_Store
**/build
**/dist
*.tgz
47 changes: 15 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-light-no-text_ok9auy.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656578320/animo-logo-dark-no-text_fqqdq9.svg">
<img alt="Animo Logo" height="250px" />
</picture>
</p>

<h1 align="center" ><b>OpenID Federation</b></h1>

<h4 align="center">Powered by &nbsp;
<picture>
<source media="(prefers-color-scheme: light)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-light-text_cma2yo.svg">
<source media="(prefers-color-scheme: dark)" srcset="https://res.cloudinary.com/animo-solutions/image/upload/v1656579715/animo-logo-dark-text_uccvqa.svg">
<img alt="Animo Logo" height="12px" />
</picture>
</h4><br>

<!-- TODO: Add relevant badges, like CI/CD, license, codecov, etc. -->

<p align="center">
<a href="https://typescriptlang.org">
<img src="https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg" />
</a>
<a href="https://yarnpkg.com">
<img src="https://img.shields.io/badge/yarn-workspaces-2188b6" />
</a>
</p>

<p align="center">
Expand All @@ -37,6 +16,8 @@
<a href="#contributing">Contributing</a>
&nbsp;|&nbsp;
<a href="#contributing">License</a>
&nbsp;|&nbsp;
<a href="#credits">Credits</a>
</p>

---
Expand All @@ -45,23 +26,17 @@

All packages are placed in the [`packages/`](./packages) directory.

| Package | Version | Description |
| ------------------------------------------------------------------- | ------- | ---------------------------------- |
| [`@openid-federation/fetch`](./packages/openid-federation-fetch) | 0.1.0 | Fetch implementation which is used to fetch the OpenID Federation. |
| [`@openid-federation/policies`](./packages/openid-federation-policies) | 0.1.0 | Policies for OpenID Federation shared. |
| [`@openid-federation/registry`](./packages/openid-federation-registry) | 0.1.0 | Implementation of the registry for OpenID Federation. |
| [`@openid-federation/registry-policies`](./packages/openid-federation-registry-policies) | 0.1.0 | Policies for the registry for OpenID Federation. |
| [`@openid-federation/resolver`](./packages/openid-federation-resolver) | 0.1.0 | Resolver implementation for OpenID Federation. |
| [`@openid-federation/resolver-policies`](./packages/openid-federation-resolver-policies) | 0.1.0 | Policies for the resolver for OpenID Federation. |


| Package | Version | Description |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| [`@openid-federation/core`](./packages/core) | [![OpenID Federation Core version on NPM](https://img.shields.io/npm/v/@openid-federation/core)](https://npmjs.com/package/@openid-federation/core) | Core implementation of OpenID Federation. |

## Getting Started

<details>
<summary>pnpm</summary>

Install dependencies:

```sh
$ pnpm install
```
Expand All @@ -70,7 +45,12 @@ $ pnpm install

## Usage

<!-- TODO: Add usage guide here -->
```sh
# npm install @openid-federation/core
# yarn install @openid-federation/core

pnpm install @openid-federation/core
```

## Contributing

Expand All @@ -81,3 +61,6 @@ contributions! To get involved, please follow our [contribution guidelines](./CO

This project is licensed under the Apache License Version 2.0 (Apache-2.0).

## Credits

This library was initially created by [Animo](https://github.com) as part of the [SPRIN-D EUDI Wallet Prototypes Funke](https://www.sprind.org/en/impulses/challenges/eudi-wallet-prototypes).
Loading

0 comments on commit 546a1c7

Please sign in to comment.