Skip to content

Commit

Permalink
Merge pull request #4 from xt0rted/split-workflows
Browse files Browse the repository at this point in the history
Split the ci workflow into two
  • Loading branch information
xt0rted authored Oct 26, 2020
2 parents 3ea40b3 + 806e060 commit bde546e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: CI

on:
pull_request:
push:
branches:
- main
branches: [main]

env:
DOTNET_NOLOGO: true
Expand All @@ -15,15 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
- name: Checkout repository
uses: actions/[email protected]

- name: Build pr suffix
if: github.event_name == 'pull_request'
run: echo "VERSION_SUFFIX=alpha.${{ github.event.number }}" >> $GITHUB_ENV

- name: Build ci suffix
if: github.event_name == 'push'
- name: Build version suffix
run: echo "VERSION_SUFFIX=beta.${{ github.run_number }}" >> $GITHUB_ENV

- name: Setup Node
Expand Down Expand Up @@ -57,5 +50,4 @@ jobs:
path: ./artifacts/*

- name: Publish to GPR
if: github.event_name == 'push'
run: dotnet nuget push ./artifacts/*.nupkg --no-symbols true --api-key ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Pull Request

on: pull_request

env:
DOTNET_NOLOGO: true
NODE_VERSION: "14.x"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Build version suffix
run: echo "VERSION_SUFFIX=alpha.${{ github.event.number }}" >> $GITHUB_ENV

- name: Setup Node
uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup .NET Core (3.1.x)
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'

- name: Setup .NET Core (global.json)
uses: actions/[email protected]

- run: npm ci

- run: dotnet build --configuration Release

- run: dotnet test --configuration Release --no-build

- run: dotnet pack --configuration Release --output ./artifacts --version-suffix $VERSION_SUFFIX

- name: Publish artifacts
uses: actions/[email protected]
with:
path: ./artifacts/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# heroicons-tag-helper

[![CI build status](https://github.com/xt0rted/heroicons-tag-helper/workflows/CI/badge.svg)](https://github.com/xt0rted/heroicons-tag-helper/actions?query=workflow%3ACI)
[![GitHub Package Registry](https://img.shields.io/badge/github-package_registry-yellow?logo=nuget)](https://nuget.pkg.github.com/xt0rted/index.json)
[![Project license](https://img.shields.io/github/license/xt0rted/heroicons-tag-helper)](LICENSE)

Expand Down

0 comments on commit bde546e

Please sign in to comment.