Skip to content

Commit

Permalink
Update GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Sep 25, 2024
1 parent 893e1fb commit 20cb4e1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This workflow will release a package at npmjs and at GitHub releases

name: Release

on:
Expand All @@ -9,40 +10,42 @@ on:
jobs:
npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish --access=public
registry-url: https://registry.npmjs.org
- name: Install and build
run: |
npm ci
npm run build
- name: Publish to npm
run: npm publish --provenance --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm pack
- name: set release name, artifact, and message
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install, build, and pack
run: |
npm ci
npm run build
npm pack
- run: |
echo "ARTIFACT_NAME=$(ls *jskos-vue-tabs-*.tgz)" >> $GITHUB_ENV
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: jskos-vue-tabs ${{ github.ref }}
name: jskos-vue-tabs ${{ github.ref_name }}
body: TODO
draft: true
prerelease: false
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.ARTIFACT_NAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/gzip
files: ${{ env.ARTIFACT_NAME }}
12 changes: 5 additions & 7 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests

name: Test and build

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]

node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down

0 comments on commit 20cb4e1

Please sign in to comment.