generated from giis-uniovi/samples-giis-template
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 2.47 KB
/
release.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
name: Publish to Maven and NuGet
on:
release:
types: [created]
jobs:
release-java:
if: ${{ false }} # disable for now
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v3
#Official documentation seems incomplete. To avoid failure when importing key:
#https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions
#It requires export the private key with the armor option: gpg --output private.pgm --armor --export-secret-key <email>
- name: Import GPG Key
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '8'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Publish to Apache Maven Central
run: mvn deploy -P publish-maven -DskipTests=true -Dmaven.test.failure.ignore=true -U --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
release-net:
#if: ${{ false }} # disable for now
runs-on: ubuntu-latest
defaults:
run:
working-directory: net
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
dotnet-version: '6.0.x'
- name: Pack
run: dotnet pack --configuration Release TdRules/TdRules.csproj
#- name: Push to nuget.org
# run: dotnet nuget push TdRules/nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json"
- name: Push to int.nugettest.org
run: dotnet nuget push TdRules/nupkg/*.nupkg --api-key ${{ secrets.NUGETTEST_API_KEY }} --source "https://apiint.nugettest.org/v3/index.json"