-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.pkgforge
60 lines (54 loc) · 1.64 KB
/
.pkgforge
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
name 'terraform-provider-awscreds'
org 'armorfret'
source(
type: 'git',
path: '.'
)
build do
run 'make local'
run 'mkdir zips'
sversion = version.sub(/^v/, '')
%w(darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64).each do |x|
arch_path = x.sub('/', '_')
zip_name = "#{name}_#{sversion}_#{arch_path}"
run "mkdir zips/#{name}_#{sversion}_#{arch_path}"
run "cp bin/#{name}_#{arch_path} zips/#{zip_name}/#{name}_#{sversion}"
run "cp LICENSE zips/#{zip_name}/LICENSE"
run "zip -j zips/#{zip_name}.zip zips/#{zip_name}/*"
cp "zips/#{zip_name}.zip", "#{zip_name}.zip"
end
cp 'terraform-registry-manifest.json', "#{name}_#{sversion}_manifest.json"
run "cd #{releasedir} && sha256sum *.zip *.json > #{name}_#{sversion}_SHA256SUMS"
run 'echo "$GPG_PRIVATE_KEY" | gpg --import'
gpgkey = '0xC0234F72057848C3'
run "cd #{releasedir} && gpg --local-user #{gpgkey} --detach-sign #{name}_#{sversion}_SHA256SUMS"
end
sname = @forge.name
sversion = @forge.version.sub(/^v/, '')
package(
type: 'file',
artifacts: %w(darwin/amd64 darwin/arm64 linux/amd64 linux/arm linux/arm64).map do |x|
arch_path = x.sub('/', '_')
zip_name = "#{sname}_#{sversion}_#{arch_path}.zip"
{
source: zip_name,
name: zip_name
}
end.concat([
{
source: "#{sname}_#{sversion}_manifest.json",
name: "#{sname}_#{sversion}_manifest.json"
},
{
source: "#{sname}_#{sversion}_SHA256SUMS",
name: "#{sname}_#{sversion}_SHA256SUMS"
},
{
source: "#{sname}_#{sversion}_SHA256SUMS.sig",
name: "#{sname}_#{sversion}_SHA256SUMS.sig"
}
])
)
test do
# TODO: add tests
end