-
Notifications
You must be signed in to change notification settings - Fork 7
116 lines (113 loc) · 4.76 KB
/
release-assets.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: release-assets
on:
push:
tags:
- 'v*'
env:
DOCKER_USER: berthertogen
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
REPO_NAME: ${{secrets.REPO_NAME}}
jobs:
release-asset:
runs-on: ubuntu-latest
steps:
- name: Set version
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = '${{ github.ref_name }}'
const tag_no_v = tag.replace('v', '')
core.setOutput('tag', tag)
core.setOutput('tag-no-v', tag_no_v)
- uses: actions/checkout@v3
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: true
prerelease: true
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build-test-code-scan.yml
workflow_conclusion: success
- name: Add version files
run: |
cd assets
touch version-${{ steps.set_version.outputs.tag-no-v }}
zip -d standalone-linux-64.zip "version-*"
zip -ur standalone-linux-64.zip version-${{ steps.set_version.outputs.tag-no-v }}
zip -d standalone-windows-64.zip "version-*"
zip -ur standalone-windows-64.zip version-${{ steps.set_version.outputs.tag-no-v }}
- name: Create nuget package
run: dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=${{ steps.set_version.outputs.tag-no-v }} --output nupkgs
working-directory: ./src/Weasyprint.Wrapped
- name: Add github source
run: dotnet nuget add source --username [email protected] --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/berthertogen/index.json"
working-directory: ./src/Weasyprint.Wrapped
- name: Push nuget package to github
run: dotnet nuget push "Weasyprint.Wrapped.${{ steps.set_version.outputs.tag-no-v }}.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source "github"
working-directory: ./src/Weasyprint.Wrapped/nupkgs
- name: Push nuget package to nuget
run: dotnet nuget push "Weasyprint.Wrapped.${{ steps.set_version.outputs.tag-no-v }}.nupkg" --api-key "${{ secrets.NUGET_TOKEN }}" --source https://api.nuget.org/v3/index.json
working-directory: ./src/Weasyprint.Wrapped/nupkgs
- name: Upload nuget package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "./src/Weasyprint.Wrapped/nupkgs/Weasyprint.Wrapped.${{ steps.set_version.outputs.tag-no-v }}.nupkg"
asset_name: "Weasyprint.Wrapped.${{ steps.set_version.outputs.tag-no-v }}.nupkg"
asset_content_type: application/zip
- name: Upload release asset linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: assets/standalone-linux-64.zip
asset_name: standalone-linux-64.zip
asset_content_type: application/zip
- name: Upload release asset windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: assets/standalone-windows-64.zip
asset_name: standalone-windows-64.zip
asset_content_type: application/zip
push-image-to-docker-hub:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version
uses: actions/github-script@v4
id: set_version
with:
script: |
const tag = '${{ github.ref_name }}'
const tag_no_v = tag.replace('v', '')
core.setOutput('tag', tag)
core.setOutput('tag-no-v', tag_no_v)
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: berthertogen
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push 8.0
uses: docker/build-push-action@v2
with:
context: .docker/net-sdk-weayprint/
file: .docker/net-sdk-weayprint/Dockerfile
push: true
tags: berthertogen/net-sdk-8-weayprint:latest, berthertogen/net-sdk-8-weayprint:${{ steps.set_version.outputs.tag-no-v }}