-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (81 loc) · 2.81 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This workflow is triggered when a PR for bump version is opened.
name: Draft release
# Triggered manually
# on: workflow_dispatch
# Triggered by PRs
on:
# `pull_request_target` (instead of `pull_request`) is required for autolabeler
pull_request_target:
types: [opened, synchronize, reopened]
branches:
- main
paths:
- Project.toml
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Checkout out pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
- uses: actions/setup-python@v4
- name: Setup Julia
uses: julia-actions/setup-julia@v1
- name: Instantiate dependencies
run: julia --project -e 'using Pkg; Pkg.instantiate()'
- name: Build artifact tarballs
run: julia --project make_artifacts.jl
- name: Test artifacts
run: ls -l artifacts/*.tar.gz
- name: Git commit Artifacts.toml
uses: stefanzweifel/git-auto-commit-action@v4
with:
# Commit message for the created commit.
commit_message: "ci: build artifacts and update toml"
# Glob pattern of files which should be added to the commit
# Defaults to all (.)
file_pattern: Artifacts.toml
# Prevents the shell from expanding filenames.
disable_globbing: true
# Tag name being created in the local repository and
# pushed to remote repository and defined branch.
# tagging_message: 'v1.0.0'
- name: Update release draft
id: release-drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Unfortunately, `https://github.com/actions/upload-release-asset`
# is not maintained anymore, so I use this
- name: Upload artifact tarballs
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.release-drafter.outputs.upload_url }}
overwrite: true
asset_path: |
artifacts/*.tar.gz
Artifacts.toml
- name: Generate PR message
id: get-version
run: |
version=$(.github/get_version.sh)
.github/generate_pr_msg.sh \
${{ steps.release-drafter.outputs.html_url}} \
${{ steps.release-drafter.outputs.tag_name }} \
"$version"
- name: Add PR Comment
uses: mshick/add-pr-comment@v2
with:
message-path: |
pr_msg.txt