From 7caba633bd1ae350abc9031811a8bd040bb017f8 Mon Sep 17 00:00:00 2001 From: FantasticFiasco Date: Tue, 17 Oct 2023 07:31:55 +0200 Subject: [PATCH] wip --- .github/workflows/{ci.yml => ci-cd.yml} | 13 +++++++++++-- scripts/package.json | 12 ++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) rename .github/workflows/{ci.yml => ci-cd.yml} (81%) create mode 100644 scripts/package.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-cd.yml similarity index 81% rename from .github/workflows/ci.yml rename to .github/workflows/ci-cd.yml index b804a0d1..aac704b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-cd.yml @@ -1,4 +1,4 @@ -name: CI +name: CI/CD on: push: @@ -12,7 +12,7 @@ on: workflow_dispatch: permissions: - contents: read + contents: write # Needed for the release script to create a release jobs: build: @@ -40,3 +40,12 @@ jobs: mkdir dist mv src/bin/Release/*.nupkg ./dist mv src/bin/Release/*.snupkg ./dist + # Release + - run: | + pushd ./scripts + npm ci + npm run release + popd + if: startsWith(github.ref, 'refs/tags/') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 00000000..c6e02cf3 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,12 @@ +{ + "name": "scripts", + "version": "1.0.0", + "description": "", + "private": true, + "scripts": { + "release": "node ./publish-on-tag.js" + }, + "devDependencies": { + "@octokit/rest": "20.0.2" + } +}