-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from tonyhallett/github-actions
move from appveyor to github actions
- Loading branch information
Showing
5 changed files
with
138 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Add vsix link comment to issues | ||
on: | ||
workflow_run: | ||
workflows: [Push vsix artifact pull release and comment] | ||
types: [completed] | ||
|
||
|
||
jobs: | ||
vsix-comments: | ||
if: github.event.workflow_run.conclusion=='success' && github.event.workflow_run.event=='pull_request' | ||
name: Add vsix link comment to issues | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Add vsix link comment to issues | ||
uses: tonyhallett/artifacts-url-comments@v1.1.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
prefix: Please try | ||
suffix: Does this resolve your issue ? | ||
format: name | ||
addTo: pullandissues | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Push vsix artifact pull release and comment | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
types: [opened, synchronize, edited] | ||
env: | ||
CONFIGURATION: Release | ||
VSIX_PROJECT: FineCodeCoverage | ||
jobs: | ||
push-vsix-artifact-pull-release-and-comment: | ||
name: Push vsix artifact pull release and comment | ||
runs-on: windows-2019 | ||
steps: | ||
- name: create variables | ||
shell: bash | ||
run: | | ||
echo "SOLN=${{env.VSIX_PROJECT}}.sln" >> $GITHUB_ENV | ||
echo "VSIX=${{github.workspace}}\${{env.VSIX_PROJECT}}\bin\${{env.CONFIGURATION}}\${{env.VSIX_PROJECT}}.vsix" >> $GITHUB_ENV # full path required for vsix publish | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Determine next version | ||
id: next-version | ||
uses: paulhatch/semantic-version@v4.0.1 | ||
with: | ||
short_tags: false | ||
branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || 'HEAD' }} | ||
|
||
- name: set up msbuild | ||
uses: microsoft/setup-msbuild@v1.0.2 | ||
|
||
- name: set up VSTest | ||
uses: darenm/Setup-VSTest@v1 | ||
|
||
- name: nuget restore | ||
run: nuget restore ${{env.SOLN}} | ||
|
||
- name: Set version for Visual Studio Extension | ||
uses: cezarypiatek/VsixVersionAction@1.0 | ||
with: | ||
version: ${{steps.next-version.outputs.major}}.${{steps.next-version.outputs.minor}}.${{github.run_number}}.${{steps.next-version.outputs.patch}} | ||
vsix-manifest-file: ${{env.VSIX_PROJECT}}\source.extension.vsixmanifest | ||
|
||
- name: build vsix | ||
run: | | ||
msbuild ${{env.SOLN}} /p:Configuration=${{env.CONFIGURATION}} /p:DeployExtension=False /verbosity:minimal | ||
- name: vs test solution | ||
uses: tonyhallett/vstest-solution-action@v1.0.0 | ||
|
||
# above are common steps for push and pull | ||
|
||
# pull only | ||
- name: upload vsix | ||
if: github.event_name == 'pull_request' && !github.event.pull_request.draft | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: FineCodeCoverage ( zipped vsix) | ||
path: ${{env.VSIX}} | ||
|
||
# push only | ||
- name: create release | ||
if: github.event_name == 'push' | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{steps.next-version.outputs.version_tag}} | ||
release_name: ${{steps.next-version.outputs.version_tag}} | ||
draft: false | ||
prerelease: falses | ||
- name: Update release asset | ||
if: github.event_name == 'push' | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{steps.create_release.outputs.upload_url}} | ||
asset_path: ${{env.VSIX}} | ||
asset_name: ${{env.VSIX_PROJECT}}.vsix | ||
asset_content_type: application/zip | ||
- name: add to marketplace | ||
if: github.event_name == 'push' | ||
uses: mrluje/vs-marketplace-publisher@v2 | ||
with: | ||
pat: ${{ secrets.FCC_VS_MARKET_PLACE_PUBLISH_TOKEN }} | ||
manifestPath: ${{env.VSIX_PROJECT}}\vs-market-place-manifest.json | ||
vsixPath: ${{env.VSIX}} | ||
- name: comment - released and added to marketplace | ||
if: github.event_name == 'push' | ||
uses: tonyhallett/addCommentToPullAndIssuesFromPushAction@v1.0.0 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
comment: released ${{steps.next-version.outputs.version_tag}} and available on marketplace | ||
addTo: pullandissues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters