2022-03-09 15:06:53 +00:00
name : Release Build
on :
push :
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 :
- 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'
- name : Bootstrap packages
run : npm run bootstrap
2023-06-26 12:41:30 +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
run : npm run inso-package
env :
VERSION : ${{ env.INSO_VERSION }}
2023-06-26 12:41:30 +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-26 12:41:30 +00:00
# - name: Notarize Inso CLI installer (macOS only)
# if: matrix.os == 'macos-latest'
# uses: devbotsxyz/xcode-notarize@v1
# 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-26 12:41:30 +00:00
# - name: Staple Inso CLI installer (macOS only)
# if: matrix.os == 'macos-latest'
# uses: devbotsxyz/xcode-staple@v1
# with:
# product-path: packages/insomnia-inso/artifacts/inso-${{ matrix.os }}-${{ env.INSO_VERSION }}.pkg
2022-03-09 15:06:53 +00:00
2023-06-26 12:41:30 +00:00
# - name: Notarize Inso CLI binary (macOS only)
# if: matrix.os == 'macos-latest'
# uses: devbotsxyz/xcode-notarize@v1
# 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 ...
# If there's package-lock conflicts, run `npm run bootstrap` and commit the package-lock changes
git push
```
</details>
2022-03-09 15:06:53 +00:00
destination_branch : develop
github_token : ${{ secrets.GITHUB_TOKEN }}