forked from JetBrains/intellij-community
-
-
Notifications
You must be signed in to change notification settings - Fork 183
76 lines (70 loc) · 2.68 KB
/
Copy pathIntelliJ_IDEA.yml
File metadata and controls
76 lines (70 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Rebased
on:
# we have to run on push for all release branches and pull_request for everything else to avoid github's "feature" where it
# runs the CI on the merged state but also if there are conflicts it just silently doesn't run anything and doesn't tell you why...
push:
branches:
- master
- release/*
# we only run on pull_request when the source branch name doesn't start with "release/". unfortunately branches-ignore refers to
# the source branch not the target branch so we can't do that here. we use an `if` statement in the get_version job instead
pull_request:
workflow_dispatch:
inputs:
version:
type: string
description: 'build number'
required: true
jobs:
get_version:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || !startsWith(github.event.pull_request.head.ref, 'release/')
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4.2.2
# checkout only needed to read build.txt. if run manually we specify the version as an input value
if: github.event_name != 'workflow_dispatch'
- name: get build number
id: get_version
run: |
if [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
version=${{ inputs.version }}
else
version="$(cat build.txt)"
fi
echo "version: $version"
echo "version=$version" >> "$GITHUB_OUTPUT"
build:
needs: get_version
uses: ./.github/workflows/ide_build_and_upload.yml
with:
artifacts_dir: out/idea-ce/artifacts
product: intellij_idea
version: ${{ needs.get_version.outputs.version }}
release:
name: Create Release
runs-on: ubuntu-latest
needs:
- get_version
- build
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4.1.8
- name: Create Release
# the maintainer said they archived this action because "there are much better alternatives these days"
# but i have yet to find a single alternative that works the way i want (automatically creates the tag)
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # zizmor: ignore[archived-uses]
with:
title: ${{ needs.get_version.outputs.version }}
automatic_release_tag: ${{ needs.get_version.outputs.version }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
draft: true
files: |
**/*.tar.gz
**/*.AppImage
**/*.zsync
**/*.exe
**/*.dmg
**/*.spdx.json