prerelease.yaml 22 KB

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