2020-04-26 20:33:39 +00:00
|
|
|
name: Release Core
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- core@*
|
|
|
|
|
2020-05-28 17:09:51 +00:00
|
|
|
env:
|
2020-07-31 20:32:16 +00:00
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-05-28 17:09:51 +00:00
|
|
|
GITHUB_REF: ${{ github.ref }}
|
|
|
|
GITHUB_SHA: ${{ github.sha }}
|
|
|
|
|
2020-04-26 20:33:39 +00:00
|
|
|
jobs:
|
2021-05-14 21:09:11 +00:00
|
|
|
test:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
os: [ macos-latest, windows-latest, ubuntu-latest ]
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Run tests
|
|
|
|
run: npm test
|
|
|
|
npm:
|
|
|
|
needs: [ test ]
|
|
|
|
name: npm
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
2021-05-14 21:09:11 +00:00
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Release NPM packages
|
|
|
|
run: |
|
2021-05-14 21:09:11 +00:00
|
|
|
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
2021-05-20 20:43:07 +00:00
|
|
|
npm run release
|
2021-05-14 21:09:11 +00:00
|
|
|
env:
|
2021-10-06 22:01:43 +00:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
inso_release_info:
|
|
|
|
needs: [ npm ]
|
|
|
|
name: Does Inso release exist?
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
version: ${{ steps.get-package-version.outputs.current-version }}
|
|
|
|
tag-name: ${{ steps.get-tag.outputs.tag-name }}
|
|
|
|
should-create-release: ${{ steps.check-release.outputs.should-create-release }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Get version
|
|
|
|
id: get-package-version
|
|
|
|
uses: martinbeentjes/npm-get-version-action@master
|
|
|
|
with:
|
|
|
|
path: packages/insomnia-inso
|
|
|
|
- name: Get tag for version
|
|
|
|
id: get-tag
|
|
|
|
run: echo "::set-output name=tag-name::lib@${{ steps.get-package-version.outputs.current-version }}"
|
|
|
|
- name: Find release by tag
|
|
|
|
# Finding a release by a particular tag will throw an error and fail if a release doesn't exist
|
|
|
|
continue-on-error: true
|
|
|
|
id: find-release
|
|
|
|
uses: kaliber5/action-get-release@v1
|
|
|
|
with:
|
|
|
|
token: ${{ github.token }}
|
|
|
|
tag_name: ${{ steps.get-tag.outputs.tag-name }}
|
|
|
|
- name: Check release exists
|
|
|
|
id: check-release
|
|
|
|
run: echo "::set-output name=should-create-release::${{ steps.find-release.outcome == 'failure' }}"
|
|
|
|
create_inso_release:
|
|
|
|
needs: [ inso_release_info ]
|
|
|
|
if: needs.inso_release_info.outputs.should-create-release == 'true'
|
|
|
|
name: Create Inso Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Create GitHub Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ needs.inso_release_info.outputs.tag-name }}
|
|
|
|
# The following is all taken from packages/insomnia-app/scripts/release.ts
|
|
|
|
name: "Inso CLI ${{ needs.inso_release_info.outputs.version }} 📦"
|
|
|
|
body: Full changelog ⇒ https://insomnia.rest/changelog
|
|
|
|
draft: false
|
|
|
|
prerelease: true
|
|
|
|
upload_inso:
|
|
|
|
needs: [ inso_release_info, create_inso_release ]
|
|
|
|
name: Package & release Inso
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Package Inso CLI
|
|
|
|
run: npm run inso-package
|
|
|
|
- name: Run CLI smoke tests
|
|
|
|
run: npm run test:smoke:cli
|
|
|
|
- name: Upload to GitHub Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
tag_name: ${{ needs.inso_release_info.outputs.tag-name }}
|
|
|
|
files: packages/insomnia-inso/compressed/*
|
|
|
|
fail_on_unmatched_files: true
|
|
|
|
windows_app:
|
2021-05-14 21:09:11 +00:00
|
|
|
needs: [ npm ]
|
2020-04-26 20:33:39 +00:00
|
|
|
name: Windows
|
|
|
|
runs-on: windows-2016
|
2021-10-06 22:01:43 +00:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_TARGET: 11.2.3
|
|
|
|
NPM_CONFIG_DISTURL: https://electronjs.org/headers
|
|
|
|
NPM_CONFIG_RUNTIME: electron
|
2020-04-26 20:33:39 +00:00
|
|
|
steps:
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
2020-07-28 05:18:26 +00:00
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
2020-05-28 17:09:51 +00:00
|
|
|
- uses: actions/setup-node@v1
|
2020-04-26 20:33:39 +00:00
|
|
|
with:
|
2020-07-28 05:18:26 +00:00
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Release app
|
|
|
|
run: npm run app-release
|
2020-04-26 20:33:39 +00:00
|
|
|
env:
|
2021-06-24 17:12:37 +00:00
|
|
|
CSC_LINK: ${{ secrets.DESIGNER_WINDOWS_CSC_LINK }}
|
|
|
|
CSC_KEY_PASSWORD: ${{ secrets.DESIGNER_WINDOWS_CSC_KEY_PASSWORD }}
|
2021-10-06 22:01:43 +00:00
|
|
|
mac_app:
|
2021-05-14 21:09:11 +00:00
|
|
|
needs: [ npm ]
|
2020-05-28 17:09:51 +00:00
|
|
|
name: Mac
|
|
|
|
runs-on: macos-latest
|
2021-10-06 22:01:43 +00:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_TARGET: 11.2.3
|
|
|
|
NPM_CONFIG_DISTURL: https://electronjs.org/headers
|
|
|
|
NPM_CONFIG_RUNTIME: electron
|
2020-05-28 17:09:51 +00:00
|
|
|
steps:
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
2020-07-28 05:18:26 +00:00
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
2020-05-28 17:09:51 +00:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-07-28 05:18:26 +00:00
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Release app
|
|
|
|
run: npm run app-release
|
2020-05-28 17:09:51 +00:00
|
|
|
env:
|
2020-09-18 13:40:30 +00:00
|
|
|
APPLE_ID: ${{ secrets.DESIGNER_APPLE_ID }}
|
|
|
|
APPLE_ID_PASSWORD: ${{ secrets.DESIGNER_APPLE_ID_PASSWORD }}
|
|
|
|
CSC_LINK: ${{ secrets.DESIGNER_MAC_CSC_LINK }}
|
|
|
|
CSC_KEY_PASSWORD: ${{ secrets.DESIGNER_MAC_CSC_KEY_PASSWORD }}
|
2021-10-06 22:01:43 +00:00
|
|
|
linux_app:
|
2021-05-14 21:09:11 +00:00
|
|
|
needs: [ npm ]
|
2020-04-26 20:33:39 +00:00
|
|
|
name: Linux
|
|
|
|
runs-on: ubuntu-latest
|
2021-10-06 22:01:43 +00:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_TARGET: 11.2.3
|
|
|
|
NPM_CONFIG_DISTURL: https://electronjs.org/headers
|
|
|
|
NPM_CONFIG_RUNTIME: electron
|
2020-04-26 20:33:39 +00:00
|
|
|
steps:
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Install Snapcraft
|
|
|
|
run: |
|
2020-06-10 00:32:01 +00:00
|
|
|
sudo snap install snapcraft --classic
|
|
|
|
echo "${{ secrets.SNAPCRAFT_LOGIN_FILE }}" > snapcraft.txt && snapcraft login --with snapcraft.txt
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Checkout branch
|
|
|
|
uses: actions/checkout@v1
|
2020-07-28 05:18:26 +00:00
|
|
|
- name: Read Node version from .nvmrc
|
|
|
|
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
|
|
|
id: nvm
|
2020-05-28 17:09:51 +00:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-07-28 05:18:26 +00:00
|
|
|
node-version: ${{ steps.nvm.outputs.NVMRC }}
|
2021-05-20 20:43:07 +00:00
|
|
|
- name: Bootstrap packages
|
|
|
|
run: npm run bootstrap
|
|
|
|
- name: Release app
|
|
|
|
run: npm run app-release
|
2020-04-26 20:33:39 +00:00
|
|
|
env:
|
2020-06-10 00:32:01 +00:00
|
|
|
BUILD_TARGETS: AppImage,deb,tar.gz,rpm,snap
|