Skip to content

Commit

Permalink
work on release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
GSGBen committed Sep 9, 2022
1 parent f9d1ab1 commit dcf738b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 13 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build - test

# note that a merged pull request results in a push to master so this workflow will run
# twice in that case. Leaving for now
on:
push:
branches: [ "main" ]
# this should run in the forker's context, not ours.
# pull_request_target is the one with dangerous security
pull_request:
branches: [ "main" ]

jobs:
# run tests for all pushes and pull requests
build-test:
runs-on: ubuntu-latest
steps:
- name: Retrieve code
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b

- name: Set up .NET
uses: actions/setup-dotnet@c0d4ad69d8bd405d234f1c9166d383b7a4f69ed8
with:
dotnet-version: 6.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test T2MDCliTests/
24 changes: 11 additions & 13 deletions .github/workflows/dotnet.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: build - test - publish
name: publish

# note that a merged pull request results in a push to master so this workflow will run
# twice in that case. Leaving for now
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
on:
workflow_dispatch:
inputs:
version:
description: version to tag and publish the draft with
required: true
default: vX.Y.Z

jobs:
# run tests for all pushes and pull requests
# still require a passing test just in case
build-test:
runs-on: ubuntu-latest
steps:
Expand All @@ -32,8 +32,6 @@ jobs:

publish:
runs-on: ubuntu-latest
# only publish if I've merged a pull request or pushed directly to master
if: github.event.pull_request.merged == true || github.event_name == 'push'
# require successful tests
needs:
build-test
Expand Down Expand Up @@ -120,12 +118,12 @@ jobs:
# upload the files to a draft release and show me all the commits that have been
# added since the last one. I then need to manually write up the body and set the
# title to the new version but this greatly speeds things up.
- uses: "marvinpinto/action-automatic-releases@v1.2.1"
- uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
prerelease: false
automatic_release_tag: "latest"
automatic_release_tag: "${{ github.event.inputs.version }}"
# globs are broken at the moment, specify directly
files: |
t2md-win-x64.zip
Expand Down

0 comments on commit dcf738b

Please sign in to comment.