chore: deploy Forgejo v1.18.5-0

- Deploy Forgejo v1.18.5-0.
- Download the shasum file from Codeberg.
This commit is contained in:
Dan Anglin 2023-02-24 08:23:19 +00:00
parent 50f9d96d38
commit 78f31ab007
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
3 changed files with 29 additions and 1 deletions

2
config

@ -1 +1 @@
Subproject commit f736015b1b0107f76f87004cc7a6957c84327bb4 Subproject commit 9d75346be36d2a0384ad3be44dc4ebc06dbff5ce

View file

@ -1,4 +1,9 @@
{ {
"1.18.5-0": {
"binary": "https://codeberg.org/attachments/415526b5-e483-45b6-9d46-a7078dcea461",
"signature": "https://codeberg.org/attachments/25cbf994-c045-4252-8c4f-34285d8905a1",
"shasum": "https://codeberg.org/attachments/79192b70-4bcf-4250-94e7-21085f04dd87"
},
"1.18.3-2": { "1.18.3-2": {
"binary": "https://codeberg.org/attachments/fd085cac-e462-413c-ab01-a1f36f6c1d24", "binary": "https://codeberg.org/attachments/fd085cac-e462-413c-ab01-a1f36f6c1d24",
"signature": "https://codeberg.org/attachments/a2c9b445-3077-4991-b616-50ddb2e12699" "signature": "https://codeberg.org/attachments/a2c9b445-3077-4991-b616-50ddb2e12699"

View file

@ -94,6 +94,29 @@ func downloadForgejo(version string) error {
fmt.Printf("Downloaded %s with size %d.\n", signaturePath, size) fmt.Printf("Downloaded %s with size %d.\n", signaturePath, size)
shasumPath := binaryPath + ".sha256"
shasum, err := os.Create(shasumPath)
if err != nil {
return fmt.Errorf("unable to create %s; %w", shasumPath, err)
}
defer shasum.Close()
shasumURL := m[version]["shasum"]
shasumResp, err := client.Get(shasumURL)
if err != nil {
return err
}
defer shasumResp.Body.Close()
size, err = io.Copy(shasum, shasumResp.Body)
if err != nil {
return nil
}
fmt.Printf("Downloaded %s with size %d.\n", shasumPath, size)
if err = sh.Run( if err = sh.Run(
"gpg", "gpg",
"--verify", "--verify",