-
Notifications
You must be signed in to change notification settings - Fork 28
130 lines (116 loc) · 4.84 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
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
on:
push:
tags:
- "v*"
name: Upload Release Asset
jobs:
build:
name: Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'yarn'
- name: Build project
run: |
yarn install --immutable-cache --check-cache && \
yarn build && \
yarn build -c build:update
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload plugin-all
id: upload-release-asset-yarn-plugin-all
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .yarn/plugins/@ojkelly/plugin-all.cjs
asset_name: "plugin-all.cjs"
asset_content_type: text/javascript
- name: Upload plugin-build
id: upload-release-asset-yarn-plugin-build
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .yarn/plugins/@ojkelly/plugin-build.cjs
asset_name: "plugin-build.cjs"
asset_content_type: text/javascript
- name: Upload plugin-bundle
id: upload-release-asset-yarn-plugin-bundle
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .yarn/plugins/@ojkelly/plugin-bundle.cjs
asset_name: "plugin-bundle.cjs"
asset_content_type: text/javascript
- name: Upload plugin-test
id: upload-release-asset-yarn-plugin-test
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .yarn/plugins/@ojkelly/plugin-test.cjs
asset_name: "plugin-test.cjs"
asset_content_type: text/javascript
- name: Upload package-yaml
id: upload-release-asset-package-yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: .yarn/plugins/@ojkelly/plugin-package-yaml.cjs
asset_name: "plugin-package-yaml.cjs"
asset_content_type: text/javascript
- name: Update release redirects
run: |
export TAGNAME=$(echo "${{ github.ref }}" | sed 's|refs/tags/||g')
sed -i'' "4s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-all.cjs\"|" netlify.toml
sed -i'' "10s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-build.cjs\"|" netlify.toml
sed -i'' "16s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-build.cjs\"|" netlify.toml
sed -i'' "22s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-bundle.cjs\"|" netlify.toml
sed -i'' "28s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-bundle.cjs\"|" netlify.toml
sed -i'' "34s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-test.cjs\"|" netlify.toml
sed -i'' "40s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-test.cjs\"|" netlify.toml
sed -i'' "54s|.*| to = \"https://github.com/ojkelly/yarn.build/releases/download/$TAGNAME/plugin-package-yaml.cjs\"|" netlify.toml
# Commit new version
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update release version to ${{ github.ref }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: update-release-version
delete-branch: true
title: "release: Update release version to ${{ github.ref }}"
base: main
labels: |
report
automated pr
assignees: ojkelly
reviewers: ojkelly
team-reviewers: |
owners
maintainers
draft: false