prerelease.yaml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. on:
  2. push:
  3. tags:
  4. - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
  5. name: Create prerelease w/ binaries and docker image
  6. jobs:
  7. build-push-porter:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Get tag name
  11. id: tag_name
  12. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  13. env:
  14. GITHUB_TAG: ${{ github.ref }}
  15. - name: Checkout
  16. uses: actions/checkout@v3
  17. - name: Setup docker
  18. uses: docker/login-action@v1
  19. with:
  20. username: ${{ secrets.DOCKERHUB_USERNAME }}
  21. password: ${{ secrets.DOCKERHUB_TOKEN }}
  22. - name: Write Dashboard Environment Variables
  23. run: |
  24. cat >./dashboard/.env <<EOL
  25. NODE_ENV=production
  26. APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
  27. ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
  28. EOL
  29. cat ./dashboard/.env
  30. - name: Build
  31. run: |
  32. DOCKER_BUILDKIT=1 docker build . -t porter1/porter:${{steps.tag_name.outputs.tag}} -f ./ee/docker/ee.Dockerfile --build-arg version=${{steps.tag_name.outputs.tag}}
  33. - name: Push
  34. run: |
  35. docker push porter1/porter:${{steps.tag_name.outputs.tag}}
  36. - name: Configure AWS credentials
  37. uses: aws-actions/configure-aws-credentials@v1-node16
  38. with:
  39. aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
  40. aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
  41. aws-region: us-east-2
  42. - name: Login to ECR public
  43. id: login-ecr
  44. run: |
  45. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
  46. - name: Push to ECR public
  47. run: |
  48. docker tag porter1/porter:${{steps.tag_name.outputs.tag}} public.ecr.aws/o1j4x7p4/porter:${{steps.tag_name.outputs.tag}}
  49. docker push public.ecr.aws/o1j4x7p4/porter:${{steps.tag_name.outputs.tag}}
  50. build-push-provisioner:
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Get tag name
  54. id: tag_name
  55. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  56. env:
  57. GITHUB_TAG: ${{ github.ref }}
  58. - name: Checkout
  59. uses: actions/checkout@v3
  60. - name: Configure AWS credentials
  61. uses: aws-actions/configure-aws-credentials@v1-node16
  62. with:
  63. aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
  64. aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
  65. aws-region: us-east-2
  66. - name: Login to ECR public
  67. id: login-ecr
  68. run: |
  69. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
  70. - name: Build
  71. run: |
  72. DOCKER_BUILDKIT=1 docker build . -t public.ecr.aws/o1j4x7p4/provisioner-service:${{steps.tag_name.outputs.tag}} -f ./ee/docker/provisioner.Dockerfile
  73. - name: Push to ECR public
  74. run: |
  75. docker push public.ecr.aws/o1j4x7p4/provisioner-service:${{steps.tag_name.outputs.tag}}
  76. build-push-worker-pool:
  77. runs-on: ubuntu-latest
  78. steps:
  79. - name: Get tag name
  80. id: tag_name
  81. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  82. env:
  83. GITHUB_TAG: ${{ github.ref }}
  84. - name: Checkout
  85. uses: actions/checkout@v3
  86. - name: Configure AWS credentials
  87. uses: aws-actions/configure-aws-credentials@v1-node16
  88. with:
  89. aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
  90. aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
  91. aws-region: us-east-2
  92. - name: Login to ECR public
  93. id: login-ecr
  94. run: |
  95. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
  96. - name: Build
  97. run: |
  98. DOCKER_BUILDKIT=1 docker build . -t public.ecr.aws/o1j4x7p4/worker-pool:${{steps.tag_name.outputs.tag}} -f ./workers/Dockerfile
  99. - name: Push to ECR public
  100. run: |
  101. docker push public.ecr.aws/o1j4x7p4/worker-pool:${{steps.tag_name.outputs.tag}}
  102. build-linux:
  103. name: Build Linux binaries
  104. runs-on: ubuntu-latest
  105. steps:
  106. - name: Get tag name
  107. id: tag_name
  108. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  109. env:
  110. GITHUB_TAG: ${{ github.ref }}
  111. - name: Checkout code
  112. uses: actions/checkout@v3
  113. - name: Set up Go
  114. uses: actions/setup-go@v3
  115. with:
  116. go-version: 1.19
  117. - name: Set up Node
  118. uses: actions/setup-node@v3
  119. with:
  120. node-version: 18
  121. - name: Write Dashboard Environment Variables
  122. run: |
  123. cat >./dashboard/.env <<EOL
  124. NODE_ENV=production
  125. APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
  126. ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
  127. EOL
  128. - name: Build and zip static folder
  129. run: |
  130. mkdir -p ./release/static
  131. cd dashboard
  132. npm i --production=false --legacy-peer-deps
  133. npm run build
  134. cd ..
  135. zip --junk-paths ./release/static/static_${{steps.tag_name.outputs.tag}}.zip ./dashboard/build/*
  136. env:
  137. NODE_ENV: production
  138. NODE_OPTIONS: --openssl-legacy-provider
  139. - name: Build Linux binaries
  140. run: |
  141. go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=${{steps.tag_name.outputs.tag}}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./porter ./cli &
  142. go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -o ./docker-credential-porter ./cmd/docker-credential-porter/ &
  143. go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -tags ee -o ./portersvr ./cmd/app/ &
  144. wait
  145. env:
  146. GOOS: linux
  147. GOARCH: amd64
  148. CGO_ENABLED: 0
  149. # Note: we have to zip all binaries before uploading them as artifacts --
  150. # without this step, the binaries will be uploaded but the file metadata will
  151. # be listed as plaintext after downloading the artifact in a later step
  152. #
  153. # TODO: investigate
  154. - name: Zip Linux binaries
  155. run: |
  156. mkdir -p ./release/linux
  157. zip --junk-paths ./release/linux/porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./porter
  158. zip --junk-paths ./release/linux/portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./portersvr
  159. zip --junk-paths ./release/linux/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip ./docker-credential-porter
  160. - name: Upload binaries
  161. uses: actions/upload-artifact@v3
  162. with:
  163. path: ./release/linux
  164. name: linux-binaries
  165. retention-days: 1
  166. - name: Upload static binaries
  167. uses: actions/upload-artifact@v3
  168. with:
  169. path: ./release/static
  170. name: static-binaries
  171. retention-days: 1
  172. build-mac:
  173. name: Build MacOS binaries
  174. runs-on: macos-11
  175. steps:
  176. - name: Get tag name
  177. id: tag_name
  178. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  179. env:
  180. GITHUB_TAG: ${{ github.ref }}
  181. - name: Checkout code
  182. uses: actions/checkout@v3
  183. - name: Set up Go
  184. uses: actions/setup-go@v3
  185. with:
  186. go-version: 1.19
  187. - name: Write Dashboard Environment Variables
  188. run: |
  189. cat >./dashboard/.env <<EOL
  190. NODE_ENV=production
  191. APPLICATION_CHART_REPO_URL=https://charts.getporter.dev
  192. ADDON_CHART_REPO_URL=https://chart-addons.getporter.dev
  193. EOL
  194. - name: Build and Zip MacOS amd64 binaries
  195. run: |
  196. go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=${{steps.tag_name.outputs.tag}}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./amd64/porter ./cli &
  197. go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -o ./amd64/docker-credential-porter ./cmd/docker-credential-porter/ &
  198. go build -ldflags="-w -s -X 'main.Version=${{steps.tag_name.outputs.tag}}'" -a -tags ee -o ./amd64/portersvr ./cmd/app/ &
  199. wait
  200. mkdir -p ./release/darwin
  201. zip --junk-paths ./release/darwin/UNSIGNED_porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/porter
  202. zip --junk-paths ./release/darwin/UNSIGNED_portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/portersvr
  203. zip --junk-paths ./release/darwin/UNSIGNED_docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip ./amd64/docker-credential-porter
  204. env:
  205. GOOS: darwin
  206. GOARCH: amd64
  207. CGO_ENABLED: 0
  208. - name: Upload binaries
  209. uses: actions/upload-artifact@v3
  210. with:
  211. path: ./release/darwin
  212. name: mac-binaries
  213. retention-days: 1
  214. notarize:
  215. name: Notarize Darwin binaries
  216. runs-on: macos-11
  217. needs: build-mac
  218. steps:
  219. - name: Get tag name
  220. id: tag_name
  221. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  222. env:
  223. GITHUB_TAG: ${{ github.ref }}
  224. - name: Download binaries
  225. uses: actions/download-artifact@v3
  226. with:
  227. name: mac-binaries
  228. path: release/
  229. - name: Unzip Darwin binaries
  230. run: |
  231. unzip ./release/UNSIGNED_porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  232. unzip ./release/UNSIGNED_portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  233. unzip ./release/UNSIGNED_docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  234. - name: Import Code-Signing Certificates
  235. uses: Apple-Actions/import-codesign-certs@v1
  236. with:
  237. # The certificates in a PKCS12 file encoded as a base64 string
  238. p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
  239. # The password used to import the PKCS12 file.
  240. p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
  241. - name: Install gon via HomeBrew for code signing and app notarization
  242. run: |
  243. brew tap porter-dev/gon
  244. brew install porter-dev/gon/gon
  245. - name: Create a porter.gon.json file
  246. run: |
  247. echo "
  248. {
  249. \"source\": [\"./porter\"],
  250. \"bundle_id\": \"cli.porter\",
  251. \"apple_id\": {
  252. \"password\": \"@env:AC_PASSWORD\"
  253. },
  254. \"sign\": {
  255. \"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
  256. },
  257. \"zip\": {
  258. \"output_path\": \"./release/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
  259. }
  260. }
  261. " > ./porter.gon.json
  262. - name: Create a portersvr.gon.json file
  263. run: |
  264. echo "
  265. {
  266. \"source\": [\"./portersvr\"],
  267. \"bundle_id\": \"cli.portersvr\",
  268. \"apple_id\": {
  269. \"password\": \"@env:AC_PASSWORD\"
  270. },
  271. \"sign\": {
  272. \"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
  273. },
  274. \"zip\": {
  275. \"output_path\": \"./release/portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
  276. }
  277. }
  278. " > ./portersvr.gon.json
  279. - name: Create a docker-credential-porter.gon.json file
  280. run: |
  281. echo "
  282. {
  283. \"source\": [\"./docker-credential-porter\"],
  284. \"bundle_id\": \"cli.docker-credential-porter\",
  285. \"apple_id\": {
  286. \"password\": \"@env:AC_PASSWORD\"
  287. },
  288. \"sign\": {
  289. \"application_identity\": \"${{ secrets.AC_APPLICATION_IDENTITY }}\"
  290. },
  291. \"zip\": {
  292. \"output_path\": \"./release/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip\"
  293. }
  294. }
  295. " > ./docker-credential-porter.gon.json
  296. - name: Sign the mac binaries with Gon
  297. env:
  298. AC_USERNAME: ${{ secrets.AC_USERNAME }}
  299. AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
  300. run: |
  301. gon ./porter.gon.json &
  302. gon ./portersvr.gon.json &
  303. gon ./docker-credential-porter.gon.json &
  304. wait
  305. - name: Upload binaries
  306. uses: actions/upload-artifact@v3
  307. with:
  308. path: ./release
  309. name: mac-binaries
  310. retention-days: 1
  311. release:
  312. name: Zip binaries, create release and upload assets
  313. runs-on: ubuntu-latest
  314. needs:
  315. - notarize
  316. - build-linux
  317. steps:
  318. - name: Get tag name
  319. id: tag_name
  320. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  321. env:
  322. GITHUB_TAG: ${{ github.ref }}
  323. - name: Download binaries
  324. uses: actions/download-artifact@v3
  325. with:
  326. name: linux-binaries
  327. path: release/linux
  328. - name: Download binaries
  329. uses: actions/download-artifact@v3
  330. with:
  331. name: static-binaries
  332. path: release/static
  333. - name: Download binaries
  334. uses: actions/download-artifact@v3
  335. with:
  336. name: mac-binaries
  337. path: release/darwin
  338. - name: Create Release
  339. id: create_release
  340. uses: actions/create-release@v1
  341. env:
  342. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  343. with:
  344. tag_name: ${{ github.ref }}
  345. release_name: Release ${{ github.ref }}
  346. draft: false
  347. prerelease: true
  348. - name: Upload Linux CLI Release Asset
  349. id: upload-linux-cli-release-asset
  350. uses: actions/upload-release-asset@v1
  351. env:
  352. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  353. GITHUB_TAG: ${{ github.ref }}
  354. with:
  355. upload_url: ${{ steps.create_release.outputs.upload_url }}
  356. asset_path: ./release/linux/porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  357. asset_name: porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  358. asset_content_type: application/zip
  359. - name: Upload Linux Server Release Asset
  360. id: upload-linux-server-release-asset
  361. uses: actions/upload-release-asset@v1
  362. env:
  363. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  364. GITHUB_TAG: ${{ github.ref }}
  365. with:
  366. upload_url: ${{ steps.create_release.outputs.upload_url }}
  367. asset_path: ./release/linux/portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  368. asset_name: portersvr_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  369. asset_content_type: application/zip
  370. - name: Upload Linux Docker Credential Release Asset
  371. id: upload-linux-docker-cred-release-asset
  372. uses: actions/upload-release-asset@v1
  373. env:
  374. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  375. GITHUB_TAG: ${{ github.ref }}
  376. with:
  377. upload_url: ${{ steps.create_release.outputs.upload_url }}
  378. asset_path: ./release/linux/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  379. asset_name: docker-credential-porter_${{steps.tag_name.outputs.tag}}_Linux_x86_64.zip
  380. asset_content_type: application/zip
  381. - name: Upload Darwin CLI Release Asset
  382. id: upload-darwin-cli-release-asset
  383. uses: actions/upload-release-asset@v1
  384. env:
  385. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  386. GITHUB_TAG: ${{ github.ref }}
  387. with:
  388. upload_url: ${{ steps.create_release.outputs.upload_url }}
  389. asset_path: ./release/darwin/porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  390. asset_name: porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  391. asset_content_type: application/zip
  392. - name: Upload Darwin Server Release Asset
  393. id: upload-darwin-server-release-asset
  394. uses: actions/upload-release-asset@v1
  395. env:
  396. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  397. GITHUB_TAG: ${{ github.ref }}
  398. with:
  399. upload_url: ${{ steps.create_release.outputs.upload_url }}
  400. asset_path: ./release/darwin/portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  401. asset_name: portersvr_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  402. asset_content_type: application/zip
  403. - name: Upload Darwin Docker Credential Release Asset
  404. id: upload-darwin-docker-cred-release-asset
  405. uses: actions/upload-release-asset@v1
  406. env:
  407. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  408. GITHUB_TAG: ${{ github.ref }}
  409. with:
  410. upload_url: ${{ steps.create_release.outputs.upload_url }}
  411. asset_path: ./release/darwin/docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  412. asset_name: docker-credential-porter_${{steps.tag_name.outputs.tag}}_Darwin_x86_64.zip
  413. asset_content_type: application/zip
  414. - name: Upload Static Release Asset
  415. id: upload-static-release-asset
  416. uses: actions/upload-release-asset@v1
  417. env:
  418. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  419. GITHUB_TAG: ${{ github.ref }}
  420. with:
  421. upload_url: ${{ steps.create_release.outputs.upload_url }}
  422. asset_path: ./release/static/static_${{steps.tag_name.outputs.tag}}.zip
  423. asset_name: static_${{steps.tag_name.outputs.tag}}.zip
  424. asset_content_type: application/zip
  425. build-push-docker-cli:
  426. name: Build a new porter-cli docker image
  427. runs-on: ubuntu-latest
  428. needs: release
  429. steps:
  430. - name: Get tag name
  431. id: tag_name
  432. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  433. env:
  434. GITHUB_TAG: ${{ github.ref }}
  435. - name: Checkout
  436. uses: actions/checkout@v3
  437. - name: Configure AWS credentials
  438. uses: aws-actions/configure-aws-credentials@v1-node16
  439. with:
  440. aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
  441. aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
  442. aws-region: us-east-2
  443. - name: Login to ECR public
  444. id: login-ecr
  445. run: |
  446. aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/o1j4x7p4
  447. - name: Login to GHCR
  448. id: login-ghcr
  449. run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
  450. - name: Build
  451. run: |
  452. docker build ./services/porter_cli_container \
  453. -t public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}} \
  454. -f ./services/porter_cli_container/Dockerfile \
  455. --build-arg VERSION=${{steps.tag_name.outputs.tag}} \
  456. --build-arg SENTRY_DSN=${{secrets.SENTRY_DSN}}
  457. - name: Push to ECR public
  458. run: docker push public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}}
  459. - name: Push to GHCR
  460. run: |
  461. docker tag public.ecr.aws/o1j4x7p4/porter-cli:${{steps.tag_name.outputs.tag}} ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
  462. docker push ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
  463. update-porter-update-action:
  464. name: Update porter-update-action
  465. runs-on: ubuntu-latest
  466. needs: build-push-docker-cli
  467. steps:
  468. - name: Get tag name
  469. id: tag_name
  470. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  471. env:
  472. GITHUB_TAG: ${{ github.ref }}
  473. - name: Push new branch with updated CLI
  474. run: |
  475. cd $GITHUB_WORKSPACE
  476. git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-update-action
  477. cd porter-update-action
  478. git checkout -B "${{steps.tag_name.outputs.tag}}"
  479. cat >Dockerfile <<EOL
  480. FROM ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
  481. LABEL org.opencontainers.image.source="https://github.com/porter-dev/porter"
  482. COPY entrypoint.sh /action/
  483. ENTRYPOINT ["/action/entrypoint.sh"]
  484. EOL
  485. git config user.name "Update Bot"
  486. git config user.email "support@porter.run"
  487. git add .
  488. git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
  489. git push --set-upstream origin ${{steps.tag_name.outputs.tag}} -f
  490. update-porter-cli-action:
  491. name: Update porter-cli-action
  492. runs-on: ubuntu-latest
  493. needs: build-push-docker-cli
  494. steps:
  495. - name: Get tag name
  496. id: tag_name
  497. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  498. env:
  499. GITHUB_TAG: ${{ github.ref }}
  500. - name: Push new branch with updated CLI
  501. run: |
  502. cd $GITHUB_WORKSPACE
  503. git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/porter-cli-action
  504. cd porter-cli-action
  505. git checkout -B "${{steps.tag_name.outputs.tag}}"
  506. cat >Dockerfile <<EOL
  507. FROM ghcr.io/porter-dev/porter/porter-cli:${{steps.tag_name.outputs.tag}}
  508. LABEL org.opencontainers.image.source="https://github.com/porter-dev/porter"
  509. COPY entrypoint.sh /action/
  510. ENTRYPOINT ["/action/entrypoint.sh"]
  511. EOL
  512. git config user.name "Update Bot"
  513. git config user.email "support@porter.run"
  514. git add .
  515. git commit -m "Update to CLI version ${{steps.tag_name.outputs.tag}}"
  516. git push --set-upstream origin ${{steps.tag_name.outputs.tag}} -f
  517. update-new-release-tests:
  518. name: Update new-release-tests
  519. runs-on: ubuntu-latest
  520. needs: [update-porter-update-action, update-porter-cli-action]
  521. steps:
  522. - name: Get tag name
  523. id: tag_name
  524. run: echo "tag=${GITHUB_TAG/refs\/tags\//}" >> $GITHUB_OUTPUT
  525. env:
  526. GITHUB_TAG: ${{ github.ref }}
  527. - name: Update new-release-tests
  528. run: |
  529. cd $GITHUB_WORKSPACE
  530. git clone https://portersupport:${{ secrets.PORTER_DEV_GITHUB_TOKEN }}@github.com/porter-dev/new-release-tests
  531. cd new-release-tests/.github/workflows
  532. sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
  533. sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_pack_production.yml
  534. sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
  535. sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' porter_test_docker_production.yml
  536. sed -i 's/uses: porter-dev\/porter-update-action.*/uses: porter-dev\/porter-update-action@${{ steps.tag_name.outputs.tag }}/g' test_porter_cli.yml
  537. sed -i 's/uses: porter-dev\/porter-cli-action.*/uses: porter-dev\/porter-cli-action@${{ steps.tag_name.outputs.tag }}/g' test_porter_cli.yml
  538. cd ../..
  539. git config user.name "Update Bot"
  540. git config user.email "support@porter.run"
  541. git diff --quiet --exit-code || git add . && git commit -m "Update to Porter GHA version ${{steps.tag_name.outputs.tag}}" && git push -f
  542. git checkout test-preview-env
  543. git merge main -m "Merge with main"
  544. sed -i 's/TEST:v.*/TEST:${{ steps.tag_name.outputs.tag }}/g' porter.yaml
  545. git diff --quiet --exit-code || git add . && git commit -m "Update to Porter GHA version ${{steps.tag_name.outputs.tag}}" && git push -f
  546. run-new-release-tests-workflows:
  547. name: Run new-release-tests Porter workflows
  548. runs-on: ubuntu-latest
  549. needs: update-new-release-tests
  550. steps:
  551. - name: Run porter_test_pack_production.yml workflow
  552. run: gh workflow run porter_test_pack_production.yml --repo porter-dev/new-release-tests
  553. env:
  554. GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}
  555. - name: Run porter_test_docker_production.yml workflow
  556. run: gh workflow run porter_test_docker_production.yml --repo porter-dev/new-release-tests
  557. env:
  558. GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}
  559. - name: Run test_porter_cli.yml workflow
  560. run: gh workflow run test_porter_cli.yml --repo porter-dev/new-release-tests
  561. env:
  562. GITHUB_TOKEN: ${{ secrets.PORTER_DEV_GITHUB_TOKEN }}