Repository navigation
53 lines (48 loc) · 1.62 KB
/
Copy pathrelease.yml
File metadata and controls
53 lines (48 loc) · 1.62 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
name: Release
# Builds every DraftCraft package when a version tag is pushed (packages.yml) and attaches them to
# that tag's GitHub release: macOS (Apple silicon and Intel DMG and CLI zip), Windows (x64 and arm64
# installer and zip) and Linux (x86_64 and aarch64 AppImage and .deb). The files carry no version in their names, so
# releases/latest/download/<name> always gives the newest.
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build and release, e.g. v0.1.0"
required: true
type: string
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
packages:
uses: ./.github/workflows/packages.yml
with:
ref: ${{ inputs.tag || github.ref }}
# Signing and notarization use the repository's secrets when they are set (packages.yml).
secrets: inherit
release:
needs: packages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: assets
merge-multiple: true
- name: Attach to the release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
set -euo pipefail
cd assets
sha256sum * > SHA256SUMS.txt
if ! gh release view "$TAG" -R "$GITHUB_REPOSITORY" > /dev/null 2>&1; then
gh release create "$TAG" -R "$GITHUB_REPOSITORY" --title "DraftCraft $TAG" --notes "DraftCraft $TAG"
fi
gh release upload "$TAG" -R "$GITHUB_REPOSITORY" --clobber ./*