From eda1fd31c42ffe7dee5293083501a24c79faa417 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 22 Jun 2024 10:10:48 +0100 Subject: [PATCH] Add forgejo workflows (#184) # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. - Add the forgejo workflows to the repo - The secret `NPM_TOKEN` has been added organisation wide #172 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration. # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://git.vylpes.xyz/RabbitLabs/random-bunny/pulls/184 Reviewed-by: VylpesTester Co-authored-by: Ethan Lane Co-committed-by: Ethan Lane --- .forgejo/workflows/publish.yml | 36 ++++++++++++++++++++++++++++++++++ .forgejo/workflows/test.yml | 26 ++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .forgejo/workflows/publish.yml create mode 100644 .forgejo/workflows/test.yml diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..0289985 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -0,0 +1,36 @@ +name: Publish to NPM + +on: + push: + tags: + - '*' + +jobs: + build: + + runs-on: node + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + - run: yarn install --frozen-lockfile + - run: yarn build + - run: yarn test + - run: yarn lint + + publish: + needs: build + runs-on: node + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + - run: yarn install --frozen-lockfile + - run: yarn build + - uses: https://github.com/JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..6c856d9 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,26 @@ +name: Test + +on: + push: + branches: + - feature/* + - hotfix/* + - renovate/* + - dependabot/* + - develop + +jobs: + build: + + runs-on: node + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + - run: yarn install --frozen-lockfile + - run: yarn build + - run: yarn test + - run: yarn lint \ No newline at end of file