-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 1.97 KB
/
release.yml
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
name: release
on:
push:
branches: [main]
paths: ["src/version.cr"]
workflow_dispatch:
permissions:
contents: write
id-token: write
attestations: write
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: fetch crystal version
id: crystal-version
run: echo "crystal=$(cat .crystal-version)" >> $GITHUB_OUTPUT
- name: install crystal
uses: crystal-lang/[email protected]
with:
crystal: ${{ steps.crystal-version.outputs.crystal }}
- name: bootstrap
run: script/bootstrap --ci
- name: fetch version
run: |
export RELEASE_VERSION=$(grep -o 'v[0-9]\+\.[0-9]\+\.[0-9]\+' src/version.cr)
echo "VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
- name: test
run: script/test
- name: build (linux x86_64)
run: |
mkdir -p releases
script/build --production
mv ./bin/runway ./releases/runway-linux-x86_64
- name: generate artifact attestation
uses: actions/[email protected]
with:
subject-path: 'releases/runway-*'
- uses: actions/upload-artifact@v4
with:
name: runway-binaries
path: releases/
- uses: actions/[email protected]
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Push a Release
id: release
uses: ncipollo/[email protected]
with:
artifacts: "./releases/*"
tag: ${{ env.VERSION }}
generateReleaseNotes: true
artifactErrorsFailBuild: true
replacesArtifacts: true
token: ${{ steps.app-token.outputs.token }}
- name: release url
env:
RELEASE_URL: ${{ steps.release.outputs.html_url }}
run: |
echo "release url: $RELEASE_URL"