Prerelease (#43) #56
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
name: Monocle CLI (Linux) | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '6.0.x' | |
- name: Install dependencies | |
working-directory: ./Monocle.CLI | |
run: dotnet restore | |
- name: Test | |
working-directory: ./Monocle.CLI | |
run: dotnet test --no-restore --verbosity normal | |
- name: Build | |
working-directory: ./Monocle.CLI | |
run: dotnet publish -c Release -r linux-x64 --self-contained -o Monocle.CLI -p:PublishTrimmed=true | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v0.4.${{ github.run_number }} | |
release_name: Monocle Linux CLI v0.4.${{ github.run_number }} | |
body: "" | |
draft: false | |
prerelease: false | |
- name: Compress CLI | |
working-directory: ./Monocle.CLI | |
run: tar czvf ../Monocle.CLI.tar.gz ./Monocle.CLI | |
- name: Upload Release Asset | |
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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./Monocle.CLI.tar.gz | |
asset_name: Monocle.CLI.tar.gz | |
asset_content_type: application/gzip | |
- name: Delete Older Releases | |
uses: dev-drprasad/delete-older-releases@v0.2.0 | |
with: | |
keep_latest: 6 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |