-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(all) Add CI & config for publishing packages on each
master
commit
- Loading branch information
Showing
3 changed files
with
96 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: .NET Core | ||
name: .NET Core build & test | ||
|
||
on: [push] | ||
|
||
|
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,93 @@ | ||
name: .NET Core publish packages | ||
|
||
on: [push] | ||
# TODO: enable for master branch only when ready. | ||
# branches: | ||
# - master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Get current timestamp | ||
id: timestamp | ||
run: echo "::set-output name=timestamp::$(date +'%Y%m%d-%H%M')" | ||
|
||
- uses: actions/checkout@v1 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.101 | ||
|
||
# | ||
# Build releases | ||
# | ||
- name: Build linux-x64 release | ||
run: dotnet publish -c Release -r linux-x64 --self-contained true | ||
working-directory: ./Perlang.ConsoleApp | ||
|
||
- name: Build osx-x64 release | ||
run: dotnet publish -c Release -r osx-x64 --self-contained true | ||
working-directory: ./Perlang.ConsoleApp | ||
|
||
- name: Build win-x64 release | ||
run: dotnet publish -c Release -r win-x64 --self-contained true | ||
working-directory: ./Perlang.ConsoleApp | ||
|
||
# | ||
# Create .tar.gz archives | ||
# | ||
- name: Create linux-x64 .tar.gz file | ||
run: tar cvzf ../perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-linux-x64.tar.gz * | ||
working-directory: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/linux-x64/publish | ||
|
||
- name: Create osx-x64 .tar.gz file | ||
run: tar cvzf ../perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-osx-x64.tar.gz * | ||
working-directory: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/osx-x64/publish | ||
|
||
- name: Create win-x64 .tar.gz file | ||
run: tar cvzf ../perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-win-x64.tar.gz * | ||
working-directory: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/win-x64/publish | ||
|
||
# | ||
# Upload files to bintray | ||
# | ||
- name: Upload linux-x64 .tar.gz file to Bintray | ||
uses: gbl08ma/github-action-upload-bintray@master | ||
with: | ||
file: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/linux-x64/perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-linux-x64.tar.gz | ||
api_user: ${{ secrets.BINTRAY_API_USER }} | ||
api_key: ${{ secrets.BINTRAY_API_KEY }} | ||
repository_user: perlang | ||
repository: builds | ||
package: perlang | ||
version: build | ||
publish: 1 | ||
calculate_metadata: false | ||
|
||
- name: Upload osx-x64 .tar.gz file to Bintray | ||
uses: gbl08ma/github-action-upload-bintray@master | ||
with: | ||
file: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/osx-x64/perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-osx-x64.tar.gz | ||
api_user: ${{ secrets.BINTRAY_API_USER }} | ||
api_key: ${{ secrets.BINTRAY_API_KEY }} | ||
repository_user: perlang | ||
repository: builds | ||
package: perlang | ||
version: build | ||
publish: 1 | ||
calculate_metadata: false | ||
|
||
- name: Upload win-x64 .tar.gz file to Bintray | ||
uses: gbl08ma/github-action-upload-bintray@master | ||
with: | ||
file: ./Perlang.ConsoleApp/bin/Release/netcoreapp3.1/win-x64/perlang-${{steps.timestamp.outputs.timestamp}}-${{github.sha}}-win-x64.tar.gz | ||
api_user: ${{ secrets.BINTRAY_API_USER }} | ||
api_key: ${{ secrets.BINTRAY_API_KEY }} | ||
repository_user: perlang | ||
repository: builds | ||
package: perlang | ||
version: build | ||
publish: 1 | ||
calculate_metadata: false |
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