2022-03-09 15:06:53 +00:00
name : Release Build
on :
2023-08-10 09:34:50 +00:00
push :
2022-03-09 15:06:53 +00:00
branches :
- 'release/**'
concurrency :
group : ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress : true
jobs :
build-and-upload-release-artifacts :
runs-on : ${{ matrix.os }}
strategy :
fail-fast : false
matrix :
include :
2023-06-27 18:16:03 +00:00
- os : macos-latest
csc_link_secret : DESIGNER_MAC_CSC_LINK
csc_key_password_secret : DESIGNER_MAC_CSC_KEY_PASSWORD
2022-03-09 15:06:53 +00:00
- os : windows-latest
2022-11-17 15:06:26 +00:00
csc_link_secret : DESIGNER_WINDOWS_CSC_LINK
csc_key_password_secret : DESIGNER_WINDOWS_CSC_KEY_PASSWORD
2022-03-09 15:06:53 +00:00
- os : ubuntu-latest
csc_link_secret : ''
csc_key_password_secret : ''
steps :
- name : Checkout branch
uses : actions/checkout@v3
- name : Setup Node
uses : actions/setup-node@v3
with :
node-version-file : '.nvmrc'
2023-08-09 22:14:16 +00:00
cache : 'npm'
cache-dependency-path : package-lock.json
2022-03-09 15:06:53 +00:00
2023-08-09 22:14:16 +00:00
- name : Install packages
run : npm ci
2022-03-09 15:06:53 +00:00
2023-06-27 18:16:03 +00:00
- name : Package app (MacOS only)
if : matrix.os == 'macos-latest'
shell : bash
run : npm run app-package
env :
NODE_OPTIONS : '--max_old_space_size=6144'
APPLE_ID : ${{ matrix.os == 'macos-latest' && secrets.DESIGNER_APPLE_ID || '' }}
APPLE_APP_SPECIFIC_PASSWORD : ${{ matrix.os == 'macos-latest' && secrets.DESIGNER_APPLE_ID_PASSWORD || '' }}
CSC_LINK : ${{ matrix.csc_link_secret != '' && secrets[matrix.csc_link_secret] || '' }}
CSC_KEY_PASSWORD : ${{ matrix.csc_key_password_secret != '' && secrets[matrix.csc_key_password_secret] || '' }}
2022-11-17 15:06:26 +00:00
2022-12-12 13:13:35 +00:00
- name : Package app (Windows and Linux)
if : matrix.os != 'macos-latest'
shell : bash
run : npm run app-package
env :
NODE_OPTIONS : '--max_old_space_size=6144'
2022-03-09 15:06:53 +00:00
- name : Setup Inso CLI version env var
run :
echo "INSO_VERSION=$(jq .version packages/insomnia-inso/package.json -rj)" >> $GITHUB_ENV
- name : Package inso
2023-08-10 09:04:28 +00:00
run : |
echo "Replacing electron binary with node binary"
node_modules/.bin/node-pre-gyp install --update-binary --directory node_modules/@getinsomnia/node-libcurl
npm run inso-package
2022-03-09 15:06:53 +00:00
env :
VERSION : ${{ env.INSO_VERSION }}
2023-06-27 18:16:03 +00:00
- name : Code-sign & create Inso CLI installer (macOS only)
if : matrix.os == 'macos-latest'
run : ./src/scripts/macos-pkg.sh
shell : bash
working-directory : packages/insomnia-inso
continue-on-error : false
env :
MACOS_CERTIFICATE : ${{ secrets.DESIGNER_MAC_CSC_LINK }}
MACOS_CERTIFICATE_PWD : ${{ secrets.DESIGNER_MAC_CSC_KEY_PASSWORD }}
PKG_NAME : inso-${{ matrix.os }}-${{ env.INSO_VERSION }}
BUNDLE_ID : com.insomnia.inso
VERSION : ${{ env.INSO_VERSION }}
2022-03-09 15:06:53 +00:00
2023-06-27 18:16:03 +00:00
- name : Notarize Inso CLI installer (macOS only)
if : matrix.os == 'macos-latest'
2023-08-22 17:05:17 +00:00
uses : lando/notarize-action@v2
2023-06-27 18:16:03 +00:00
with :
product-path : packages/insomnia-inso/artifacts/inso-${{ matrix.os }}-${{ env.INSO_VERSION }}.pkg
primary-bundle-id : com.insomnia.inso
appstore-connect-username : ${{ secrets.DESIGNER_APPLE_ID }}
appstore-connect-password : ${{ secrets.DESIGNER_APPLE_ID_PASSWORD }}
2022-03-09 15:06:53 +00:00
2023-06-27 18:16:03 +00:00
- name : Staple Inso CLI installer (macOS only)
if : matrix.os == 'macos-latest'
2023-08-22 17:05:17 +00:00
uses : BoundfoxStudios/action-xcode-staple@v1
2023-06-27 18:16:03 +00:00
with :
product-path : packages/insomnia-inso/artifacts/inso-${{ matrix.os }}-${{ env.INSO_VERSION }}.pkg
2022-03-09 15:06:53 +00:00
2023-06-27 18:16:03 +00:00
- name : Notarize Inso CLI binary (macOS only)
if : matrix.os == 'macos-latest'
2023-08-22 17:05:17 +00:00
uses : lando/notarize-action@v2
2023-06-27 18:16:03 +00:00
with :
product-path : packages/insomnia-inso/binaries/inso
primary-bundle-id : com.insomnia.inso-binary
appstore-connect-username : ${{ secrets.DESIGNER_APPLE_ID }}
appstore-connect-password : ${{ secrets.DESIGNER_APPLE_ID_PASSWORD }}
2022-03-09 15:06:53 +00:00
- name : Create inso artifacts
run : npm run inso-package:artifacts
2022-05-09 11:37:33 +00:00
- name : Create Docker Image artifacts
if : matrix.os == 'ubuntu-latest'
run : |
2022-05-09 14:40:04 +00:00
DOCKER_BUILDKIT=1 docker build --tag insomnia-inso:temp ./packages/insomnia-inso/
2022-05-09 11:37:33 +00:00
docker save insomnia-inso:temp -o ./packages/insomnia-inso/artifacts/inso-docker-image.tar
2022-03-09 15:06:53 +00:00
- name : Upload artifacts
uses : actions/upload-artifact@v3
with :
if-no-files-found : ignore
name : ${{ matrix.os }}-artifacts
path : |
2022-04-20 17:42:19 +00:00
packages/insomnia/dist/*.exe
packages/insomnia/dist/squirrel-windows/*
packages/insomnia/dist/*.zip
packages/insomnia/dist/*.dmg
packages/insomnia/dist/*.snap
packages/insomnia/dist/*.rpm
packages/insomnia/dist/*.deb
packages/insomnia/dist/*.AppImage
packages/insomnia/dist/*.tar.gz
2022-03-09 15:06:53 +00:00
packages/insomnia-inso/artifacts/*
2022-06-28 09:29:28 +00:00
- name : Upload source assets for Sentry
uses : actions/upload-artifact@v3
with :
name : ${{ matrix.os }}-sentry
path : |
packages/insomnia/build/*.js
packages/insomnia/build/*.map
!packages/insomnia/build/yarn-standalone.js
2022-03-09 15:06:53 +00:00
update-pull-request :
needs : build-and-upload-release-artifacts
runs-on : ubuntu-latest
steps :
- name : Get release version
id : release_version
shell : bash
run : |
2022-10-17 12:14:47 +00:00
echo "version=${BRANCH/release\//}" >> $GITHUB_OUTPUT
2022-03-09 15:06:53 +00:00
env :
BRANCH : ${{ github.ref_name }}
- name : update-pull-request
2022-10-31 08:54:01 +00:00
uses : kt3k/update-pr-description@v2.0.0
2022-03-09 15:06:53 +00:00
with :
pr_body : |
Download release artifacts [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
## Steps for Publish:
When ready to publish, trigger [Publish](https://github.com/${{ github.repository }}/actions/workflows/release-publish.yml) workflow with these variables:
- Release version (`version`) : `${{ steps.release_version.outputs.version }}`
Alternatively, you can trigger the workflow from [Github CLI](https://cli.github.com/) :
```bash
2022-03-09 16:21:01 +00:00
gh workflow run release-publish.yml -f version=${{ steps.release_version.outputs.version }} --repo ${{ github.repository }}
2022-03-09 15:06:53 +00:00
```
2022-03-24 12:20:24 +00:00
<details>
<summary>Conflicts? Merge branch step failed on the publish workflow? Try this...</summary>
Run locally :
```bash
# Make sure git remote is Kong/insomnia...
git checkout develop
git merge --no-ff release/<replaced with version>
# Solve merge conflicts ...
2023-08-09 22:14:16 +00:00
# If there's package-lock conflicts, run `npm install` and commit the package-lock changes
2022-03-24 12:20:24 +00:00
git push
```
</details>
2022-03-09 15:06:53 +00:00
destination_branch : develop
github_token : ${{ secrets.GITHUB_TOKEN }}