Repository navigation
85 lines (68 loc) · 2.62 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (68 loc) · 2.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
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
name: Release
on:
push:
tags: ["v*"]
jobs:
verify-version:
name: Verify the tag matches the project version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Guard against tagging a commit whose version was never bumped: the tag
# and mix.exs must agree before anything is published. ash-ci.yml checks
# that the version reached Hex, not that the tag names the right one.
#
# Read from the @version literal rather than Mix.Project.config/0, which
# would mean fetching every dependency to print one string.
- run: |
project_version="$(sed -n 's/^ @version "\(.*\)"$/\1/p' mix.exs)"
tag_version="${GITHUB_REF_NAME#v}"
if [ -z "$project_version" ]; then
echo "No @version found in mix.exs."
exit 1
fi
if [ "$project_version" != "$tag_version" ]; then
echo "Tag ${GITHUB_REF_NAME} does not match mix.exs version ${project_version}."
exit 1
fi
echo "Publishing ${project_version}."
release:
needs: verify-version
uses: ash-project/ash/.github/workflows/ash-ci.yml@main
with:
release: true
# HexDocs already receives the docs from `mix hex.publish`. The Pages
# deploy is a second copy that needs Pages configured on the repository.
publish-docs: false
# Enforces ash-project's own community files byte for byte. This repo has
# its own code of conduct, whose enforcement contact is Alembic's.
community-files: false
# Everything below duplicates a tool `mix check` already runs in ci.yml,
# or does not apply to this library. See .check.exs for the real gate.
unused-deps: false
deps-audit: false
hex-audit: false
doctor: false
codegen: false
igniter-upgrade: false
# Not a Phoenix app; no endpoints or templates for sobelow to analyse.
sobelow: false
# `mix check` runs `mix docs`, which regenerates the cheat sheets through
# the `docs` alias and fails on a drifted DSL document.
spark-cheat-sheets: false
spark-formatter: false
# The Postgres and Oban integration tests run in ci.yml, against the
# postgres service defined there.
postgres: false
tenants: false
ash_postgres: false
conventional-commit: false
# Validated when the file is parsed, so a nested job that never runs still
# needs its permissions granted.
permissions:
contents: write
pages: write
id-token: write
security-events: write
secrets:
hex_api_key: ${{ secrets.HEX_API_KEY }}