Skip to content

Commit

Permalink
updated workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Amndeep Singh Mann <[email protected]>
  • Loading branch information
Amndeep7 committed Apr 12, 2023
1 parent a3c219d commit 073d4b4
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-approve-and-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
approve:
name: Auto-approve dependabot PRs
if: github.event.pull_request.user.login == 'dependabot[bot]' && contains(github.event.pull_request.labels.*.name, 'dependencies')
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2
- uses: hmarr/auto-approve-action@v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:

jobs:
build-deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install Nullsoft Scriptable Install System and p7zip
run: sudo apt install nsis p7zip-full
Expand All @@ -23,28 +23,28 @@ jobs:
run: rm -rf test

- name: Install project dependencies
run: npm install
run: npm ci

- name: Pack Windows Installer
run: yarn run oclif pack win
run: npx oclif pack win

- name: Pack Debian Package
run: sudo yarn run oclif pack deb
run: sudo npx oclif pack deb

- name: Upload SAF-CLI Windows Build x64 Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: SAF-CLI Windows Build x64
path: dist/win32/saf-*-x64.exe

- name: Upload SAF-CLI Windows Build x86 Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: SAF-CLI Windows Build x86
path: dist/win32/saf-*-x86.exe

- name: Upload SAF-CLI Debian x64 Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: SAF-CLI Debian Build x64
path: dist/deb/saf_*.deb
path: dist/deb/saf-*.deb
16 changes: 8 additions & 8 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ jobs:
build-deploy:
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install project dependencies
run: npm install
run: npm ci

- name: Remove testing resources
run: rm -rf test

- name: npm install and pack
run: yarn run oclif pack macos
- name: npm pack
run: npx oclif pack macos

- name: Upload SAF-CLI macOS Installer Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: SAF-CLI macOS Installer
path: dist/macos/saf-*.pkg
path: dist/macos/saf-*.pkg
13 changes: 11 additions & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ name: Draft Release

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_draft_release:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.2.0
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 5 additions & 15 deletions .github/workflows/e2e-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,19 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.lock') }}
restore-keys: |
${{ runner.os }}-node-
cache: 'npm'

- name: Install dependencies
run: npm install
run: npm ci

- name: Prepack
run: npm run prepack
Expand Down
24 changes: 6 additions & 18 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,19 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'

- name: Install project dependencies
run: yarn install --frozen-lockfile
run: npm ci

- name: Run lint
run: yarn run lint:ci
run: npm run lint:ci
2 changes: 1 addition & 1 deletion .github/workflows/push-to-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Run string replace
uses: frabert/replace-string-action@master
uses: frabert/replace-string-action@v2
id: format-tag
with:
pattern: 'v'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/push-to-npm-gpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ on:

jobs:
build-deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: setup node
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Remove testing resources
run: rm -rf test

- name: Install project dependencies
run: yarn install --frozen-lockfile --production
run: npm ci

- name: Pack all items that are published as packages
run: yarn pack
run: npm pack

- name: Publish SAF CLI to NPM
run: npm publish --access public mitre-saf-v*.tgz
Expand All @@ -39,4 +39,4 @@ jobs:
- name: Publish SAF CLI to GPR
run: npm publish --access public mitre-saf-v*.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 073d4b4

Please sign in to comment.