Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing release cycles/workflow #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
# runs-on: ${{ matrix.os }}

# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest]
# fail-fast: false

steps:
- id: checkout
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,30 @@ on:
push:
branches:
- "main"
- "next"

permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
if: "!contains(github.event.head_commit.message, '[skip ci]')"

permissions:
contents: write

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: oven-sh/setup-bun@v1

# - name: Changelog
# uses: scottbrenner/generate-changelog-action@master
# id: changelog
# with:
# package-dir: "./package.json"

- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Run semantic release
run: |
bun run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
}
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/npm",
[
"@semantic-release/exec",
{
"prepareCmd": "yarn run build"
}
],
"@semantic-release/changelog",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"changelog"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist"
}
]
}
]
]
}
Binary file modified bun.lockb
Binary file not shown.
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eldenring-json",
"version": "0.0.1",
"version": "0.0.0-semantically-released",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"description": "collection of available data for Elden Ring by Fromsoft",
Expand All @@ -9,6 +9,7 @@
"prebuild": "rm -rf dist",
"build:types": "tsc --emitDeclarationOnly --noEmit false --declaration true",
"publish": "bunx @morlay/bunpublish",
"release": "bunx semantic-release",
"prepublishOnly": "bun run build"
},
"files": [
Expand All @@ -30,8 +31,12 @@
"bugs": "https://github.com/joeyfigaro/eldenring-json/issues",
"author": "Joey Figaro <[email protected]>",
"devDependencies": {
"bun-plugin-dts": "^0.2.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/bun": "^1.0.0",
"bun-plugin-dts": "^0.2.1",
"semantic-release": "^23.0.6",
"typescript": "^5.2.2"
}
}
15 changes: 10 additions & 5 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { describe, it, expect } from 'bun:test';
import { ammos } from '../src';
import { describe, it, expect } from "bun:test";
import * as json from "../src";

describe('data exports', () => {
it('should include ammo', () => {
expect(ammos).toBeDefined();
describe("available JSON data", () => {
const availableKeys = Object.keys(json);

availableKeys.forEach((key) => {
it(`should include ${key}`, () => {
// @ts-expect-error
expect(json[key]).toBeDefined();
});
});
});
Loading