Skip to content

Commit

Permalink
fix(ci): cleaning up github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Nov 30, 2023
1 parent 406c675 commit 9161814
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 27 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
pull_request:
branches: ["main"]

jobs:
validator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: RoadieHQ/backstage-entity-validator@70da3dfb77cb4d0e150b9f6de953b806837d16df # tag=v0.3.2
with:
path: 'catalog-info.yaml'
##
# Runs semantic release in a dryRun configuration
##
check-semver:
name: Check Semantic Release Type
timeout-minutes: 15
runs-on: ubuntu-latest

# https://github.com/semantic-release/npm
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm
- name: Install dependencies
run: npm ci
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Check SemVer
run: npm release:check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
61 changes: 35 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
name: Node.js Package

name: Build
on:
pull_request:
branches:
- main
push:
branches:
- main

push:
branches: ["main"]

jobs:
validator:
##
# Runs semantic release in a regular
##
check-semver:
name: Check Semantic Release Type
timeout-minutes: 15
runs-on: ubuntu-latest

# https://github.com/semantic-release/npm
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: RoadieHQ/backstage-entity-validator@70da3dfb77cb4d0e150b9f6de953b806837d16df # tag=v0.3.2
- name: Check out code
uses: actions/checkout@v4
with:
path: 'catalog-info.yaml'
fetch-depth: 2

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
- uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048 # tag=v3.2.0
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '16.x'
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@pocket-tools'
- run: npm ci
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
- run: npm install -g npm
- name: Install dependencies
run: npm ci
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Check SemVer
run: npm release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"bin/install.js"
],
"scripts": {
"postinstall": "node bin/install.js"
"postinstall": "node bin/install.js",
"release": "semantic-release",
"release:check": "semantic-release --dryRun"
},
"keywords": [
"tsconfig"
Expand Down

0 comments on commit 9161814

Please sign in to comment.