Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: layer5io/rtk-query-codegen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.2
Choose a base ref
...
head repository: layer5io/rtk-query-codegen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: refs/heads/master
Choose a head ref
  • 12 commits
  • 4 files changed
  • 3 contributors

Commits on Dec 20, 2023

  1. Update release-drafter.yml

    Signed-off-by: Lee Calcote <leecalcote@gmail.com>
    leecalcote authored Dec 20, 2023
    Copy the full SHA
    0a94977 View commit details

Commits on Dec 21, 2023

  1. update release workflow

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    88e4983 View commit details
  2. fix trigger

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    efadee8 View commit details
  3. Merge pull request #9 from aabidsofi19/ci/release-workflow

    [CI] Update release workflow
    aabidsofi19 authored Dec 21, 2023
    Copy the full SHA
    976cf03 View commit details
  4. remove conflicts

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    19a7a43 View commit details
  5. Merge pull request #10 from aabidsofi19/ci/release-workflow

    add release script
    aabidsofi19 authored Dec 21, 2023
    Copy the full SHA
    0b5c385 View commit details
  6. add github token workflow

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    884b6b7 View commit details
  7. Merge pull request #11 from aabidsofi19/ci/release-workflow

    add github token workflow
    aabidsofi19 authored Dec 21, 2023
    Copy the full SHA
    167d328 View commit details
  8. add github token workflow

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    bf41412 View commit details
  9. Merge pull request #12 from aabidsofi19/ci/release-workflow

    update checkout action version
    aabidsofi19 authored Dec 21, 2023
    Copy the full SHA
    2cd9810 View commit details
  10. add github token workflow

    Signed-off-by: aabidsofi19 <mailtoaabid01@gmail.com>
    aabidsofi19 committed Dec 21, 2023
    Copy the full SHA
    ae84d65 View commit details
  11. Merge pull request #13 from aabidsofi19/ci/release-workflow

    bump checkout action
    aabidsofi19 authored Dec 21, 2023
    Copy the full SHA
    9f3f3e0 View commit details
Showing with 72 additions and 7 deletions.
  1. +2 −2 .github/release-drafter.yml
  2. +23 −4 .github/workflows/npm-publish.yml
  3. +2 −1 package.json
  4. +45 −0 release.js
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name-template: 'v$NEXT_PATCH_VERSION'
name-template: 'rtk-query-codegen v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
@@ -22,4 +22,4 @@ template: |
## Contributors
Thank you to our contributors for making this release possible:
$CONTRIBUTORS
$CONTRIBUTORS
27 changes: 23 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -8,32 +8,51 @@ on:
types: [created]
workflow_dispatch:
inputs:
release-type:
release-version:
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{secrets.GH_TOKEN}}

- uses: actions/setup-node@v3
with:
node-version: 16
- run: |
npm install
publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{secrets.GH_TOKEN}}
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
scope: "@layer5"
- run: npm publish --verbose

- name: Run npm release
run: npm run release ${{ github.event.inputs.release-version || github.event.release.tag_name }}
if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Commit and push version change
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_user_name: l5io
commit_user_email: ci@layer5.io
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit_options: "--signoff"
commit_message: "[Release]: Bump version to ${{ github.event.inputs.release-version || github.event.release.tag_name }}"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@
"description": "Codegen to create rtk-query api from openapi schema",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"release": "node ./release.js"
},
"bin": {
"rtk-query-codegen": "./src/app.js"
45 changes: 45 additions & 0 deletions release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const fs = require("fs");
const path = require("path");
// for building and release the package

// bump version
const bump = (version) => {
const packagePath = path.resolve(__dirname, "package.json");
const package = require(packagePath);
package.version = version;
fs.writeFileSync(packagePath, JSON.stringify(package, null, 2));
console.log("bumped version to " + version);
};

// build
const build = () => {
// nothing here yet
};

const publish = () => {
// publish to npm
const execSync = require("child_process").execSync;
execSync("npm publish --verbose", { stdio: [0, 1, 2] });
console.log("published to npm");
};

// main
const main = () => {
const args = process.argv.slice(2);
const version = args[0];
if (!version) {
console.error("version is required");
process.exit(1);
}
try {
bump(version);
build();
publish();
console.log("done");
} catch (e) {
console.error(e);
process.exit(1);
}
};

main();