From 0857a4c887a8ad4a75fc72c3c446945dca12d1d9 Mon Sep 17 00:00:00 2001 From: archy Date: Tue, 3 Oct 2023 01:08:29 +0800 Subject: [PATCH] gh action: disable windows signing & changelog-gen for now --- .github/workflows/changelog.yml | 344 +++++++++++++------------- .github/workflows/release-publish.yml | 79 +++--- 2 files changed, 202 insertions(+), 221 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index d491f269e..27d4bdd56 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -1,171 +1,173 @@ -name: Generate Changelog - -on: - workflow_dispatch: - inputs: - version: - required: true - description: Release version (e.g. 2022.1.0 or 2022.1.0-beta.0) - pull_request: - types: - - opened - - synchronize - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - parse-version: - if: ${{ startsWith(github.head_ref, 'release/') || github.event_name == 'workflow_dispatch' }} - runs-on: ubuntu-latest - outputs: - version: ${{ steps.version.outputs.version }} - steps: - - name: Set release version Env (workflow_dispatch) - if: github.event_name == 'workflow_dispatch' - shell: bash - run: | - echo "RELEASE_VERSION=${{ github.event.inputs.version }} " >> $GITHUB_ENV - - - name: Set release version Env (pull_request) - if: ${{ startsWith(github.head_ref, 'release/') }} - shell: bash - run: | - echo "RELEASE_VERSION=${BRANCH/release\//} " >> $GITHUB_ENV - env: - BRANCH: ${{ github.head_ref }} - - - name: Save release version as output - id: version - run: echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT - env: - RELEASE_VERSION: ${{ env.RELEASE_VERSION }} - - - generate-changelog: - needs: parse-version - runs-on: ubuntu-latest - steps: - - name: Find Pull Request - uses: juliangruber/find-pull-request-action@v1 - id: find-pull-request - with: - branch: release/${{ needs.parse-version.outputs.version }} - - - name: Setup Node - uses: actions/setup-node@v3 - - - name: Get latest release for Changelog - id: latest_release - uses: cardinalby/git-get-release-action@v1 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - draft: false - prerelease: false - releaseNameRegEx: Insomnium .* - repo: ${{github.repository}} - - - name: Run Changelog-generator script - id: changelog - shell: bash - run: | - npx @kong/changelog-generator generate \ - --owner ${OWNER} \ - --repo insomnia \ - --base ${{ steps.latest_release.outputs.tag_name }} \ - --head ${HEAD} \ - --releaseName "${RELEASE_NAME}" > ./temp_changelog.out - - npx @kong/changelog-generator generate \ - --owner ${OWNER} \ - --repo insomnia \ - --base ${{ steps.latest_release.outputs.tag_name }} \ - --head ${HEAD} \ - --releaseName "${RELEASE_NAME}" --onlyShowMissing > ./temp_changelog_missing.out - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OWNER: ${{ github.repository_owner }} - HEAD: release/${{ needs.parse-version.outputs.version }} - RELEASE_NAME: ${{ needs.parse-version.outputs.version }} - - - name: Read changelog - id: read-changelog - uses: juliangruber/read-file-action@v1 - with: - path: ./temp_changelog.out - - - name: Read changelog (missing) - id: read-changelog-missing - uses: juliangruber/read-file-action@v1 - with: - path: ./temp_changelog_missing.out - - - name: Set timestamp - id: timestamp - run: echo "timestamp=$(date --iso-8601=seconds)" >> $GITHUB_OUTPUT - - - name: Find Comment - uses: peter-evans/find-comment@v2 - id: find-comment - with: - issue-number: ${{ steps.find-pull-request.outputs.number }} - body-includes: Auto-generated changelog - - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v2 - with: - comment-id: ${{ steps.find-comment.outputs.comment-id }} - issue-number: ${{ steps.find-pull-request.outputs.number }} - body: | - Auto-generated changelog: - ``` - ${{ steps.read-changelog.outputs.content }} - ``` - - PRs missing a `changelog(): `: - ``` - ${{ steps.read-changelog-missing.outputs.content }} - ``` - Last Updated: ${{ steps.timestamp.outputs.timestamp }} - - You can download this release header image 🌌 [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) - - To re-trigger: - - Via UI, run [Generate Changelog workflow](https://github.com/${{ github.repository }}/actions/workflows/changelog.yml) (`version`): `${{ needs.parse-version.outputs.version }}` - - Via CLI, run [Github CLI](https://cli.github.com/): - ```bash - gh workflow run changelog.yml -f version=${{ needs.parse-version.outputs.version }} --repo ${{ github.repository }} - ``` - edit-mode: replace - - generate-changelog-image: - needs: parse-version - runs-on: ubuntu-latest - steps: - - name: Checkout branch - uses: actions/checkout@v3 - with: - ref: release/${{ needs.parse-version.outputs.version }} - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: 'npm' - cache-dependency-path: package-lock.json - - - name: Install packages - run: npm ci - - - name: Run changelog-image - run: npm run changelog-image - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - if-no-files-found: error - name: changelog-image-${{ needs.parse-version.outputs.version }} - path: | - *.svg +### to-do: figure out how to get this work + +# name: Generate Changelog + +# on: +# workflow_dispatch: +# inputs: +# version: +# required: true +# description: Release version (e.g. 2022.1.0 or 2022.1.0-beta.0) +# pull_request: +# types: +# - opened +# - synchronize + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# jobs: +# parse-version: +# if: ${{ startsWith(github.head_ref, 'release/') || github.event_name == 'workflow_dispatch' }} +# runs-on: ubuntu-latest +# outputs: +# version: ${{ steps.version.outputs.version }} +# steps: +# - name: Set release version Env (workflow_dispatch) +# if: github.event_name == 'workflow_dispatch' +# shell: bash +# run: | +# echo "RELEASE_VERSION=${{ github.event.inputs.version }} " >> $GITHUB_ENV + +# - name: Set release version Env (pull_request) +# if: ${{ startsWith(github.head_ref, 'release/') }} +# shell: bash +# run: | +# echo "RELEASE_VERSION=${BRANCH/release\//} " >> $GITHUB_ENV +# env: +# BRANCH: ${{ github.head_ref }} + +# - name: Save release version as output +# id: version +# run: echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT +# env: +# RELEASE_VERSION: ${{ env.RELEASE_VERSION }} + + +# generate-changelog: +# needs: parse-version +# runs-on: ubuntu-latest +# steps: +# - name: Find Pull Request +# uses: juliangruber/find-pull-request-action@v1 +# id: find-pull-request +# with: +# branch: release/${{ needs.parse-version.outputs.version }} + +# - name: Setup Node +# uses: actions/setup-node@v3 + +# - name: Get latest release for Changelog +# id: latest_release +# uses: cardinalby/git-get-release-action@v1 +# env: +# GITHUB_TOKEN: ${{ github.token }} +# with: +# draft: false +# prerelease: false +# releaseNameRegEx: Insomnium .* +# repo: ${{github.repository}} + +# - name: Run Changelog-generator script +# id: changelog +# shell: bash +# run: | +# npx @kong/changelog-generator generate \ +# --owner ${OWNER} \ +# --repo insomnia \ +# --base ${{ steps.latest_release.outputs.tag_name }} \ +# --head ${HEAD} \ +# --releaseName "${RELEASE_NAME}" > ./temp_changelog.out + +# npx @kong/changelog-generator generate \ +# --owner ${OWNER} \ +# --repo insomnia \ +# --base ${{ steps.latest_release.outputs.tag_name }} \ +# --head ${HEAD} \ +# --releaseName "${RELEASE_NAME}" --onlyShowMissing > ./temp_changelog_missing.out +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# OWNER: ${{ github.repository_owner }} +# HEAD: release/${{ needs.parse-version.outputs.version }} +# RELEASE_NAME: ${{ needs.parse-version.outputs.version }} + +# - name: Read changelog +# id: read-changelog +# uses: juliangruber/read-file-action@v1 +# with: +# path: ./temp_changelog.out + +# - name: Read changelog (missing) +# id: read-changelog-missing +# uses: juliangruber/read-file-action@v1 +# with: +# path: ./temp_changelog_missing.out + +# - name: Set timestamp +# id: timestamp +# run: echo "timestamp=$(date --iso-8601=seconds)" >> $GITHUB_OUTPUT + +# - name: Find Comment +# uses: peter-evans/find-comment@v2 +# id: find-comment +# with: +# issue-number: ${{ steps.find-pull-request.outputs.number }} +# body-includes: Auto-generated changelog + +# - name: Create or update comment +# uses: peter-evans/create-or-update-comment@v2 +# with: +# comment-id: ${{ steps.find-comment.outputs.comment-id }} +# issue-number: ${{ steps.find-pull-request.outputs.number }} +# body: | +# Auto-generated changelog: +# ``` +# ${{ steps.read-changelog.outputs.content }} +# ``` + +# PRs missing a `changelog(): `: +# ``` +# ${{ steps.read-changelog-missing.outputs.content }} +# ``` +# Last Updated: ${{ steps.timestamp.outputs.timestamp }} + +# You can download this release header image 🌌 [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + +# To re-trigger: +# - Via UI, run [Generate Changelog workflow](https://github.com/${{ github.repository }}/actions/workflows/changelog.yml) (`version`): `${{ needs.parse-version.outputs.version }}` +# - Via CLI, run [Github CLI](https://cli.github.com/): +# ```bash +# gh workflow run changelog.yml -f version=${{ needs.parse-version.outputs.version }} --repo ${{ github.repository }} +# ``` +# edit-mode: replace + +# generate-changelog-image: +# needs: parse-version +# runs-on: ubuntu-latest +# steps: +# - name: Checkout branch +# uses: actions/checkout@v3 +# with: +# ref: release/${{ needs.parse-version.outputs.version }} + +# - name: Setup Node +# uses: actions/setup-node@v3 +# with: +# node-version-file: ".nvmrc" +# cache: 'npm' +# cache-dependency-path: package-lock.json + +# - name: Install packages +# run: npm ci + +# - name: Run changelog-image +# run: npm run changelog-image + +# - name: Upload artifacts +# uses: actions/upload-artifact@v3 +# with: +# if-no-files-found: error +# name: changelog-image-${{ needs.parse-version.outputs.version }} +# path: | +# *.svg diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 05edb851e..47ec3e992 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -43,62 +43,41 @@ jobs: branch: ${{ env.RELEASE_BRANCH }} # Branch workflow ran on != branch the workflow created path: ./artifacts/ - - name: Temporarily move Windows artifacts - shell: bash - run: | - mv ./artifacts/windows-latest-artifacts/squirrel-windows/Insomnium.Core-${{ env.RELEASE_VERSION }}.exe ./artifacts/ - mv ./artifacts/windows-latest-artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}-portable.exe ./artifacts/ + # - name: Temporarily move Windows artifacts + # shell: bash + # run: | + # mv ./artifacts/windows-latest-artifacts/squirrel-windows/Insomnium.Core-${{ env.RELEASE_VERSION }}.exe ./artifacts/ + # mv ./artifacts/windows-latest-artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}-portable.exe ./artifacts/ - - name: Code-sign Windows .exe artifact - uses: sslcom/actions-codesigner@develop - with: - command: sign - username: ${{secrets.ES_USERNAME}} - password: ${{secrets.ES_PASSWORD}} - credential_id: ${{secrets.ES_CREDENTIAL_ID}} - totp_secret: ${{secrets.ES_TOTP_SECRET}} - file_path: ${GITHUB_WORKSPACE}/artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}.exe - output_path: ${GITHUB_WORKSPACE}/artifacts/windows-latest-artifacts/insomnia/dist/squirrel-windows - - - name: Code-sign Windows portable .exe artifact - uses: sslcom/actions-codesigner@develop - with: - command: sign - username: ${{secrets.ES_USERNAME}} - password: ${{secrets.ES_PASSWORD}} - credential_id: ${{secrets.ES_CREDENTIAL_ID}} - totp_secret: ${{secrets.ES_TOTP_SECRET}} - file_path: ${GITHUB_WORKSPACE}/artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}-portable.exe - output_path: ${GITHUB_WORKSPACE}/artifacts/windows-latest-artifacts/insomnia/dist + #### code sign windows when we hit 1.0 + + # - name: Code-sign Windows .exe artifact + # uses: sslcom/actions-codesigner@develop + # with: + # command: sign + # username: ${{secrets.ES_USERNAME}} + # password: ${{secrets.ES_PASSWORD}} + # credential_id: ${{secrets.ES_CREDENTIAL_ID}} + # totp_secret: ${{secrets.ES_TOTP_SECRET}} + # file_path: ${GITHUB_WORKSPACE}/artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}.exe + # output_path: ${GITHUB_WORKSPACE}/artifacts/windows-latest-artifacts/insomnia/dist/squirrel-windows + + # - name: Code-sign Windows portable .exe artifact + # uses: sslcom/actions-codesigner@develop + # with: + # command: sign + # username: ${{secrets.ES_USERNAME}} + # password: ${{secrets.ES_PASSWORD}} + # credential_id: ${{secrets.ES_CREDENTIAL_ID}} + # totp_secret: ${{secrets.ES_TOTP_SECRET}} + # file_path: ${GITHUB_WORKSPACE}/artifacts/Insomnium.Core-${{ env.RELEASE_VERSION }}-portable.exe + # output_path: ${GITHUB_WORKSPACE}/artifacts/windows-latest-artifacts/insomnia/dist # - name: Set Inso CLI version on Github Env # run: # echo "INSO_VERSION=$(jq .version packages/insomnia-inso/package.json -rj)" >> $GITHUB_ENV - # - name: Create Release for Inso CLI - # uses: ncipollo/release-action@v1 - # id: release_inso_cli - # with: - # tag: lib@${{ env.INSO_VERSION }} - # name: "Inso CLI ${{ env.INSO_VERSION }} 📦" - # body: "Full changelog ⇒ https://insomnia.rest/changelog" - # commit: ${{ env.RELEASE_BRANCH }} - # prerelease: ${{ env.IS_PRERELEASE }} - # draft: false - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # - name: Upload Inso CLI artifacts to release - # uses: xresloader/upload-to-github-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # release_id: ${{ steps.release_inso_cli.outputs.id }} - # tag_name: lib@${{ env.INSO_VERSION }} - # file: "./artifacts/*-latest-artifacts/insomnia-inso/artifacts/**" - # prerelease: ${{ env.IS_PRERELEASE }} - # draft: false - + - name: Create Tag and Release uses: ncipollo/release-action@v1 id: core_tag_and_release