-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (81 loc) · 3.13 KB
/
release.yml
File metadata and controls
90 lines (81 loc) · 3.13 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# GitHub Action to build releases on command
#
# This script builds and packages a release for Linux, Windows, OSX and FreeBSD
# using the stable branch. The generated archives are published as a release
# on the GitHub release page.
#
# Job overview:
# 1. Builds the actual release using `build_release_template` from dlang/installer
# 2. Publishes all artifacts from (1) to the release page on GitHub
#
# Triggered manually by authorized users via workflow_dispatch.
name: build-release
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: true
type: string
default: stable
tag:
description: 'Release tag (e.g., v2.109.0)'
required: true
type: string
prerelease:
description: 'Mark as pre-release'
required: false
type: boolean
default: false
jobs:
# Build and package a new release for all supported platforms
build-all-releases:
name: Build release from ${{ github.event.inputs.branch }}
uses: dlang/installer/.github/workflows/build_release_template.yml@master
with:
release_branch: ${{ github.event.inputs.branch }}
# Bundles and publishes the entire release
generate_release:
name: "Publish artifacts on the release page"
needs:
- build-all-releases
runs-on: ubuntu-latest
steps:
#################################################################
# Fetch all artifacts from the jobs defined above
#
- name: Download generated releases from the artifacts
uses: actions/download-artifact@v4
with:
pattern: dmd-release-*
merge-multiple: true
path: ~/artifacts/
#################################################################
# Debug: Check that all required artifacts are present
#
- name: Display all files included in the artifacts
id: list-artifacts
shell: bash
run: |
set -euox pipefail
ls -aul ~ ~/artifacts
echo "artifacts_directory=$HOME/artifacts" >> $GITHUB_OUTPUT
#################################################################
# Create the new release using the downloaded artifacts
#
- name: Create the release
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
name: DMD ${{ github.event.inputs.tag }}
prerelease: ${{ github.event.inputs.prerelease }}
body: |
Release of the reference D compiler
| Component | Revision |
| --------- | ---------------------------------------------------------------- |
| DMD | dlang/dmd@${{ needs.build-all-releases.outputs.dmd-revision }} |
| Phobos | dlang/phobos@${{ needs.build-all-releases.outputs.phobos-revision }} |
artifacts: ${{ steps.list-artifacts.outputs.artifacts_directory }}/*
artifactErrorsFailBuild: true
tag: ${{ github.event.inputs.tag }}
commit: ${{ needs.build-all-releases.outputs.dmd-revision }}