Replace release creation with gh CLI (#2608)
* replace release creation with gh CLI * Create nightly builds abstraction with tag creation * Enable also workflow dispatch for main nighlty build
This commit is contained in:

committed by
GitHub

parent
19330bab65
commit
08c4535308
36
.github/workflows/nightly-browser-view.yml
vendored
36
.github/workflows/nightly-browser-view.yml
vendored
@@ -1,9 +1,18 @@
|
|||||||
name: nightly-browser-view
|
name: nightly-browser-view
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: "Reference tag of the nightly build"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
inputs:
|
||||||
- cron: 0 4 * * 0-5
|
tag:
|
||||||
|
description: "Reference tag of the nightly build"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -12,6 +21,7 @@ defaults:
|
|||||||
env:
|
env:
|
||||||
TERM: xterm
|
TERM: xterm
|
||||||
MM_WIN_INSTALLERS: 1
|
MM_WIN_INSTALLERS: 1
|
||||||
|
REFERENCE: ${{ inputs.tag }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
@@ -19,14 +29,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: ci/checkout-repo
|
- name: ci/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: ci/setup-node
|
- name: ci/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: ci/install-dependencies
|
- name: ci/install-dependencies
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
@@ -53,14 +63,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-node
|
- name: nightly/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: nightly/optimize
|
- name: nightly/optimize
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: ./scripts/Makefile.ps1 optimize
|
run: ./scripts/Makefile.ps1 optimize
|
||||||
@@ -109,14 +119,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-node
|
- name: nightly/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: nightly/install-dependencies
|
- name: nightly/install-dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install yq
|
brew install yq
|
||||||
@@ -139,14 +149,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-node
|
- name: nightly/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: nightly/install-dependencies
|
- name: nightly/install-dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install yq rename
|
brew install yq rename
|
||||||
@@ -185,8 +195,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
- name: nightly/patch-version
|
with:
|
||||||
uses: ./.github/actions/patch-nightly-version
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-aws-credentials
|
- name: nightly/setup-aws-credentials
|
||||||
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
||||||
with:
|
with:
|
||||||
@@ -232,4 +242,4 @@ jobs:
|
|||||||
--arg username "NightBuilder" \
|
--arg username "NightBuilder" \
|
||||||
--arg text "${{ needs.upload-to-s3.outputs.links }}" \
|
--arg text "${{ needs.upload-to-s3.outputs.links }}" \
|
||||||
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
|
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
|
||||||
curl -i -X POST -H "Content-Type: application/json" -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_NIGHTLY_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
curl -i -X POST -H "Content-Type: application/json" -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_NIGHTLY_WEBHOOK_URL }}
|
||||||
|
26
.github/workflows/nightly-rainforest.yml
vendored
26
.github/workflows/nightly-rainforest.yml
vendored
@@ -1,9 +1,18 @@
|
|||||||
name: nightly-rainforest
|
name: nightly-rainforest
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: "Reference tag of the nightly build"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
inputs:
|
||||||
- cron: 0 4 * * 0-5
|
tag:
|
||||||
|
description: "Reference tag of the nightly build"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -14,6 +23,7 @@ env:
|
|||||||
MM_DESKTOP_BUILD_DISABLEGPU: true
|
MM_DESKTOP_BUILD_DISABLEGPU: true
|
||||||
MM_DESKTOP_BUILD_SKIPONBOARDINGSCREENS: true
|
MM_DESKTOP_BUILD_SKIPONBOARDINGSCREENS: true
|
||||||
MM_WIN_INSTALLERS: 1
|
MM_WIN_INSTALLERS: 1
|
||||||
|
REFERENCE: ${{ inputs.tag }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-msi-installer:
|
build-msi-installer:
|
||||||
@@ -21,14 +31,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-node
|
- name: nightly/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: nightly/optimize
|
- name: nightly/optimize
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: ./scripts/Makefile.ps1 optimize
|
run: ./scripts/Makefile.ps1 optimize
|
||||||
@@ -69,14 +79,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
with:
|
||||||
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-node
|
- name: nightly/setup-node
|
||||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||||
with:
|
with:
|
||||||
node-version-file: "package.json"
|
node-version-file: "package.json"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
cache-dependency-path: package-lock.json
|
cache-dependency-path: package-lock.json
|
||||||
- name: nightly/patch-version
|
|
||||||
uses: ./.github/actions/patch-nightly-version
|
|
||||||
- name: nightly/install-dependencies
|
- name: nightly/install-dependencies
|
||||||
run: |
|
run: |
|
||||||
brew install yq rename
|
brew install yq rename
|
||||||
@@ -112,8 +122,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: nightly/checkout-repo
|
- name: nightly/checkout-repo
|
||||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
- name: nightly/patch-version
|
with:
|
||||||
uses: ./.github/actions/patch-nightly-version
|
ref: ${{ env.REFERENCE }}
|
||||||
- name: nightly/setup-aws-credentials
|
- name: nightly/setup-aws-credentials
|
||||||
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
||||||
with:
|
with:
|
||||||
|
42
.github/workflows/nightly.yaml
vendored
Normal file
42
.github/workflows/nightly.yaml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
name: nightly-builds
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: 0 4 * * 0-5
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag-nightly-build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
tag: ${{ steps.tag-creation.outputs.tag }}
|
||||||
|
steps:
|
||||||
|
- name: nightly/checkout-repo
|
||||||
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||||
|
- name: nightly/patch-version
|
||||||
|
uses: ./.github/actions/patch-nightly-version
|
||||||
|
- name: nightly/create-nightly-build-tag
|
||||||
|
id: tag-creation
|
||||||
|
run: |
|
||||||
|
git config --global user.email "nightly-build@mattermost.com"
|
||||||
|
git config --global user.name "Nightly Build"
|
||||||
|
git checkout -b "$(jq -r .version package.json)"
|
||||||
|
git add package.json
|
||||||
|
git commit -m "Nightly build $(jq -r .version package.json)"
|
||||||
|
git tag "$(jq -r .version package.json)" -m "Nightly build $(jq -r .version package.json)"
|
||||||
|
git push --tags --force
|
||||||
|
echo "tag=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
nightly-browser-view:
|
||||||
|
needs:
|
||||||
|
- tag-nightly-build
|
||||||
|
uses: ./.github/workflows/nightly-browser-view.yml
|
||||||
|
with:
|
||||||
|
tag: ${{ needs.tag-nightly-build.outputs.tag }}
|
||||||
|
|
||||||
|
nightly-rainforest:
|
||||||
|
needs:
|
||||||
|
- tag-nightly-build
|
||||||
|
uses: ./.github/workflows/nightly-rainforest.yml
|
||||||
|
with:
|
||||||
|
tag: ${{ needs.tag-nightly-build.outputs.tag }}
|
16
.github/workflows/release.yaml
vendored
16
.github/workflows/release.yaml
vendored
@@ -228,20 +228,14 @@ jobs:
|
|||||||
mkdir -p ./ghr-dist
|
mkdir -p ./ghr-dist
|
||||||
find ./build/{macos-release,win-release,linux} -type f -exec cp --backup=numbered -t ./ghr-dist {} +
|
find ./build/{macos-release,win-release,linux} -type f -exec cp --backup=numbered -t ./ghr-dist {} +
|
||||||
- name: release/publish-release
|
- name: release/publish-release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.MATTERMOST_BUILD_GH_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
go install github.com/tcnksm/ghr@latest
|
|
||||||
VERSION=$(jq -r .version package.json)
|
VERSION=$(jq -r .version package.json)
|
||||||
|
./scripts/generate_release_markdown.sh ${VERSION} > release-notes.md
|
||||||
RELEASE_TITLE="v${VERSION} ($(date -u "+%Y-%m-%d"))"
|
RELEASE_TITLE="v${VERSION} ($(date -u "+%Y-%m-%d"))"
|
||||||
ghr \
|
[[ $VERSION =~ "-rc" ]] && PRERELEASE="--prerelease"
|
||||||
-t ${GITHUB_TOKEN} \
|
gh release create --draft ${PRERELEASE} --verify-tag -F release-notes.md --target "${GITHUB_SHA}" --title "${RELEASE_TITLE}" "${GITHUB_REF_NAME}" ./ghr-dist/*
|
||||||
-u ${GITHUB_ACTOR} \
|
|
||||||
-draft \
|
|
||||||
--body="$(./scripts/generate_release_markdown.sh $VERSION)" \
|
|
||||||
--name="${RELEASE_TITLE}" $( [[ $VERSION =~ "-rc" ]] && printf %s "-prerelease") \
|
|
||||||
-r ${GITHUB_REPOSITORY} \
|
|
||||||
-c ${GITHUB_SHA} \
|
|
||||||
-delete \
|
|
||||||
v${VERSION} ./ghr-dist
|
|
||||||
|
|
||||||
end-notification:
|
end-notification:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
Reference in New Issue
Block a user