-
Notifications
You must be signed in to change notification settings - Fork 14
136 lines (113 loc) · 4.08 KB
/
release.yaml
File metadata and controls
136 lines (113 loc) · 4.08 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Release pipeline
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
draft:
description: "Create a draft release (unchecked: full release)"
required: true
default: true
type: boolean
permissions:
contents: write
jobs:
build-haskell-debugger:
uses: ./.github/workflows/debugger.yaml
# Build and Test using the haskell-debugger sdist and haskell-debugger-view
# from hackage. This requires that haskell-debugger-view on hackage be
# compatible with the version being released.
with:
use-haskell-debugger-view-from-hackage: true
is-release: true
docs-haskell-debugger:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: haskell-actions/setup@v2
with:
ghc-version: 9.14.1
cabal-version: 3.14
ghcup-release-channel: https://raw.githubusercontent.com/haskell/ghcup-metadata/refs/heads/develop/ghcup-prereleases-0.0.9.yaml
- name: Build docs for haskell-debugger
run: cabal haddock --haddock-for-hackage --enable-documentation
- name: Upload haskell-debugger docs
uses: actions/upload-artifact@v4
with:
name: Haskell Debugger Docs
path: dist-newstyle/haskell-debugger*docs.tar.gz
validate-tag:
name: Validate tag is at master HEAD
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure tag points to master HEAD
shell: bash
run: |
echo "Tag ref: $GITHUB_REF"
echo "Tag commit: $GITHUB_SHA"
# Fetch latest master explicitly
git fetch origin master
MASTER_SHA=$(git rev-parse origin/master)
echo "origin/master HEAD: $MASTER_SHA"
if [[ "$GITHUB_SHA" != "$MASTER_SHA" ]]; then
echo "Tag does not point to the tip of master."
echo "Tag SHA: $GITHUB_SHA"
echo "Master SHA: $MASTER_SHA"
exit 1
fi
echo "Tag is exactly at master HEAD."
release:
name: Release
runs-on: ubuntu-latest
needs: [validate-tag, build-haskell-debugger, docs-haskell-debugger]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- uses: actions/download-artifact@v4
with:
name: Haskell Debugger Extension
path: ${{ runner.temp }}/extension/
- uses: actions/download-artifact@v4
with:
name: Haskell Debugger Source Distribution
path: ${{ runner.temp }}/packages/
- uses: actions/download-artifact@v4
with:
name: Haskell Debugger Docs
path: ${{ runner.temp }}/docs/
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ runner.temp }}/extension/haskell-debugger-extension-0.13.1.vsix
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
registryUrl: https://open-vsx.org
extensionFile: ${{ runner.temp }}/extension/haskell-debugger-extension-0.13.1.vsix
- name: Hackage Release
uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets.HACKAGE_AUTH_TOKEN }}
packagesPath: ${{ runner.temp }}/packages
docsPath: ${{ runner.temp }}/docs
publish: ${{ github.event_name == 'workflow_dispatch' && inputs.draft == true && 'false' || 'true' }}
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft == true }}
files: ${{ runner.temp }}/extension/*.vsix
fail_on_unmatched_files: true
generate_release_notes: true