forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (139 loc) · 5.86 KB
/
Copy pathrelease-maven-artifacts.yml
File metadata and controls
144 lines (139 loc) · 5.86 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Release Artifacts to Maven
on:
workflow_call:
inputs:
environment:
required: true
type: string
permissions:
contents: read
jobs:
release-maven-artifacts:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
MAVEN_REPOSITORY_HOST : ${{ vars.MAVEN_REPOSITORY_HOST }}
MAVEN_REPOSITORY_REALM: ${{ vars.MAVEN_REPOSITORY_REALM }}
MAVEN_REPOSITORY_URL : ${{ vars.MAVEN_REPOSITORY_URL }}
NEWNIGHTLY : ${{ vars.NEWNIGHTLY }}
NIGHTLYBUILD : ${{ vars.NIGHTLYBUILD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Import Scala PGP Key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
with:
gpg_private_key: ${{ secrets.SCALA_PGP_KEY }}
passphrase : ${{ secrets.SCALA_PGP_PASSPHRASE }}
fingerprint : ${{ vars.SCALA_PGP_FINGERPRINT }}
- name: Get version string for this build
run: |
ver=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
echo "THISBUILD_VERSION=$ver" >> $GITHUB_ENV
- name: Check whether not yet published
id: not_yet_published
continue-on-error: true
run: |
! ./project/scripts/is-version-published.sh "$THISBUILD_VERSION"
- name: Publish Artifacts to the Maven Repository
if: "steps.not_yet_published.outcome == 'success'"
run : sbt scala3-bootstrapped/publishSigned
env:
MAVEN_REPOSITORY_USER : ${{ secrets.MAVEN_REPOSITORY_USER }}
MAVEN_REPOSITORY_TOKEN: ${{ secrets.MAVEN_REPOSITORY_TOKEN }}
release-maven-lts-3.3-artifacts:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
MAVEN_REPOSITORY_HOST : ${{ vars.MAVEN_REPOSITORY_HOST }}
MAVEN_REPOSITORY_REALM: ${{ vars.MAVEN_REPOSITORY_REALM }}
MAVEN_REPOSITORY_URL : ${{ vars.MAVEN_REPOSITORY_URL }}
NEWNIGHTLY : ${{ vars.NEWNIGHTLY }}
NIGHTLYBUILD : ${{ vars.NIGHTLYBUILD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: scala/scala3-lts
ref: lts-3.3
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 8
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Setup PGP Key
run: |
echo -n "$PGP_SECRET" | gpg --batch --import
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Setup SBT PGP directory
run: |
mkdir -p "/home/runner/.sbt/gpg"
- name: Setup SBT PGP
run: |
echo "$PGP_SECRET" > "/home/runner/.sbt/gpg/secring.asc"
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
- name: Get version string for this build
run: |
ver=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
echo "THISBUILD_VERSION=$ver" >> $GITHUB_ENV
- name: Check whether not yet published
id: not_yet_published
continue-on-error: true
run: |
! ./project/scripts/is-version-published.sh "$THISBUILD_VERSION"
- name: Publish Artifacts to the Maven Repository
if: "steps.not_yet_published.outcome == 'success'"
run : ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned"
env:
SONATYPE_USER : ${{ secrets.MAVEN_REPOSITORY_USER }}
SONATYPE_PW : ${{ secrets.MAVEN_REPOSITORY_TOKEN }}
PGP_PW : ${{ secrets.PGP_PW }}
PGP_SECRET : ${{ secrets.PGP_SECRET }}
release-maven-lts-3.9-artifacts:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
MAVEN_REPOSITORY_HOST : ${{ vars.MAVEN_REPOSITORY_HOST }}
MAVEN_REPOSITORY_REALM: ${{ vars.MAVEN_REPOSITORY_REALM }}
MAVEN_REPOSITORY_URL : ${{ vars.MAVEN_REPOSITORY_URL }}
NEWNIGHTLY : ${{ vars.NEWNIGHTLY }}
NIGHTLYBUILD : ${{ vars.NIGHTLYBUILD }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: scala/scala3-lts
ref: lts-3.9
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@c7d2d6258b4bd0d3ec5129e6b3453199d3c79729 # v1.5.8
- name: Import Scala PGP Key
uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
with:
gpg_private_key: ${{ secrets.SCALA_PGP_KEY }}
passphrase : ${{ secrets.SCALA_PGP_PASSPHRASE }}
fingerprint : ${{ vars.SCALA_PGP_FINGERPRINT }}
- name: Get version string for this build
run: |
ver=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
echo "THISBUILD_VERSION=$ver" >> $GITHUB_ENV
- name: Check whether not yet published
id: not_yet_published
continue-on-error: true
run: |
! ./project/scripts/is-version-published.sh "$THISBUILD_VERSION"
- name: Publish Artifacts to the Maven Repository
if: "steps.not_yet_published.outcome == 'success'"
run : sbt scala3-bootstrapped/publishSigned
env:
MAVEN_REPOSITORY_USER : ${{ secrets.MAVEN_REPOSITORY_USER }}
MAVEN_REPOSITORY_TOKEN: ${{ secrets.MAVEN_REPOSITORY_TOKEN }}