Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd06a8d3

Browse files
committed
ci: update appcast on builds
1 parent96da5ae commitd06a8d3

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

‎.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ jobs:
4646
-name:Setup Nix
4747
uses:./.github/actions/nix-devshell
4848

49+
-name:Authenticate to Google Cloud
50+
id:gcloud_auth
51+
uses:google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935# v2.1.8
52+
with:
53+
workload_identity_provider:${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
54+
service_account:${{ secrets.GCP_SERVICE_ACCOUNT }}
55+
token_format:"access_token"
56+
4957
-name:Build
5058
env:
5159
APPLE_DEVELOPER_ID_PKCS12_B64:${{ secrets.APPLE_DEVELOPER_ID_PKCS12_B64 }}
@@ -68,6 +76,11 @@ jobs:
6876
path:${{ github.workspace }}/outputs/out
6977
retention-days:7
7078

79+
-name:Get version string
80+
id:version_string
81+
run:|
82+
echo "versionstring=$(./scripts/version.sh)" >> "$GITHUB_OUTPUT"
83+
7184
# Upload to release in non-dry-run mode
7285
-name:Upload Release Assets
7386
if:${{ !inputs.dryrun }}
@@ -76,6 +89,32 @@ jobs:
7689
GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
7790
RELEASE_TAG:${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }}
7891

92+
-name:Download Appcast
93+
# if: ${{ !inputs.dryrun }}
94+
run:|
95+
gsutil cp "gs://releases.coder.com/coder-desktop/mac/appcast.xml" ./oldappcast.xml
96+
97+
-name:Update Appcast
98+
# if: ${{ !inputs.dryrun }}
99+
run:|
100+
pushd scripts/update-appcast
101+
swift run update-appcast \
102+
-i ../../oldappcast.xml \
103+
-s "$out"/Coder-Desktop.pkg.sig \
104+
-v "$VERSION_STRING" \
105+
-o ../../appcast.xml
106+
-d "$VERSION_DESCRIPTION"
107+
popd
108+
env:
109+
VERSION_STRING:${{ steps.version_string.outputs.versionstring }}
110+
VERSION_DESCRIPTION:${{ github.event_name == 'release' && github.event.release.body || '' }}
111+
112+
113+
-name:Upload Appcast
114+
# if: ${{ !inputs.dryrun }}
115+
run:|
116+
gsutil -h "Cache-Control:no-cache,max-age=0" cp ./appcast.xml "gs://releases.coder.com/coder-desktop/mac/appcast.xml"
117+
79118
update-cask:
80119
name:Update homebrew-coder cask
81120
runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}

‎flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
gh
5050
git
5151
gnumake
52+
google-cloud-sdk
5253
protobuf_28
5354
grpc-swift.packages.${system}.protoc-gen-grpc-swift
5455
grpc-swift.packages.${system}.protoc-gen-swift

‎scripts/update-appcast/Sources/main.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct UpdateAppcast: AsyncParsableCommand {
6868
}
6969

7070
letxmlData=tryData(contentsOf:URL(fileURLWithPath: input))
71-
letdoc=tryXMLDocument(data: xmlData, options:.nodePrettyPrint)
71+
letdoc=tryXMLDocument(data: xmlData, options:[.nodePrettyPrint,.nodePreserveAll])
7272

7373
guardlet channelElem=try doc.nodes(forXPath:"/rss/channel").firstas?XMLElementelse{
7474
throwRuntimeError("<channel> element not found in appcast.")
@@ -98,7 +98,7 @@ struct UpdateAppcast: AsyncParsableCommand {
9898
item.addChild(XMLElement(name:"title", stringValue:"Preview"))
9999
}
100100

101-
iflet description{
101+
iflet description, !description.isEmpty{
102102
letdescription= description.replacingOccurrences(of:#"\r\n"#, with:"\n")
103103
letdescriptionDoc:Document
104104
do{
@@ -143,7 +143,7 @@ struct UpdateAppcast: AsyncParsableCommand {
143143

144144
channelElem.insertChild(item, at: insertionIndex)
145145

146-
letoutputStr= doc.xmlString(options:[.nodePrettyPrint])+"\n"
146+
letoutputStr= doc.xmlString(options:[.nodePrettyPrint,.nodePreserveAll])+"\n"
147147
try outputStr.write(to:URL(fileURLWithPath: output), atomically:true, encoding:.utf8)
148148
}
149149

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp