Skip to content

Commit

Permalink
fix(ci): use reusable workflow (#13)
Browse files Browse the repository at this point in the history
Is `fix:` to check if CD still works
  • Loading branch information
hairmare committed Jun 13, 2022
1 parent a02b02e commit 977b40e
Showing 1 changed file with 8 additions and 54 deletions.
62 changes: 8 additions & 54 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,15 @@
name: Test, Build, and Publish
name: Directus Extension

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize, ready_for_review]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node
- run: npm ci
- run: npm test
- run: npm run build
- run: npm pack
- uses: actions/upload-artifact@v3
with:
name: pack
path: '*.tgz'
release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: pack
- name: unpack artifact
run: |
tar xvf *.tgz --wildcards --no-anchored '*dist*' --strip-components 1
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node
- uses: go-semantic-release/action@v1
id: semrel
if: github.ref == 'refs/heads/main'
with:
github-token: ${{ secrets.ORGA_USER_TOKEN }}
allow-initial-development-versions: true
update-file: package.json
changelog-generator-opt: "emojis=true"
- run: npm publish --access=public
if: steps.semrel.outputs.version != ''
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
call-workflow:
uses: wellenplan/actions/.github/workflows/directus-extension.yaml@v0.1.0
secrets:
ORGA_USER_TOKEN: ${{ secrets.ORGA_USER_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 977b40e

Please sign in to comment.