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

Commit3c72ff4

Browse files
ci: update appcast on builds (#174)
Fourth PR for#47.Dry-run worked!https://releases.coder.com/coder-desktop/mac/appcast.xml
1 parent46074e2 commit3c72ff4

File tree

4 files changed

+41
-4
lines changed

4 files changed

+41
-4
lines changed

‎.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
permissions:
3131
# To upload assets to the release
3232
contents:write
33+
# for GCP auth
34+
id-token:write
3335
steps:
3436
-name:Checkout
3537
uses:actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683# v4.2.2
@@ -46,6 +48,17 @@ jobs:
4648
-name:Setup Nix
4749
uses:./.github/actions/nix-devshell
4850

51+
-name:Authenticate to Google Cloud
52+
id:gcloud_auth
53+
uses:google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935# v2.1.8
54+
with:
55+
workload_identity_provider:${{ secrets.GCP_WORKLOAD_ID_PROVIDER }}
56+
service_account:${{ secrets.GCP_SERVICE_ACCOUNT }}
57+
token_format:"access_token"
58+
59+
-name:Setup GCloud SDK
60+
uses:google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a# v2.1.4
61+
4962
-name:Build
5063
env:
5164
APPLE_DEVELOPER_ID_PKCS12_B64:${{ secrets.APPLE_DEVELOPER_ID_PKCS12_B64 }}
@@ -76,6 +89,22 @@ jobs:
7689
GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
7790
RELEASE_TAG:${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }}
7891

92+
-name:Update Appcast
93+
if:${{ !inputs.dryrun }}
94+
run:|
95+
gsutil cp "gs://releases.coder.com/coder-desktop/mac/appcast.xml" ./oldappcast.xml
96+
pushd scripts/update-appcast
97+
swift run update-appcast \
98+
-i ../../oldappcast.xml \
99+
-s "$out"/Coder-Desktop.pkg.sig \
100+
-v "$(../version.sh)" \
101+
-o ../../appcast.xml \
102+
-d "$VERSION_DESCRIPTION"
103+
popd
104+
gsutil -h "Cache-Control:no-cache,max-age=0" cp ./appcast.xml "gs://releases.coder.com/coder-desktop/mac/appcast.xml"
105+
env:
106+
VERSION_DESCRIPTION:${{ github.event_name == 'release' && github.event.release.body || '' }}
107+
79108
update-cask:
80109
name:Update homebrew-coder cask
81110
runs-on:${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}

‎flake.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
xcpretty
6060
zizmor
6161
];
62+
shellHook=''
63+
# Copied from https://github.com/ghostty-org/ghostty/blob/c4088f0c73af1c153c743fc006637cc76c1ee127/nix/devShell.nix#L189-L199
64+
# We want to rely on the system Xcode tools in CI!
65+
unset SDKROOT
66+
unset DEVELOPER_DIR
67+
# We need to remove the nix "xcrun" from the PATH.
68+
export PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '$0 !~ /xcrun/ || $0 == "/usr/bin" {print}' | sed 's/:$//')
69+
'';
6270
};
6371

6472
default=pkgs.mkShellNoCC{

‎scripts/update-appcast/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PackageDescription
66
letpackage=Package(
77
name:"update-appcast",
88
platforms:[
9-
.macOS(.v15),
9+
.macOS(.v14),
1010
],
1111
dependencies:[
1212
.package(url:"https://github.com/apple/swift-argument-parser", from:"1.3.0"),

‎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