-
Notifications
You must be signed in to change notification settings - Fork 50
122 lines (120 loc) · 3.42 KB
/
preview-release.yaml
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
name: Preview Release
on:
workflow_run:
workflows: ["CI"]
types:
- completed
push:
# Run only on trunk pushes that aren't a new tag release
branches: [trunk, reese-hack-special-release]
tags-ignore: "*"
env:
BUNDLE_PATH: /tmp/.bundle
GEM_HOME: /tmp/.bundle
GEM_PATH: /tmp/.bundle
TERM: xterm256
FORCE_FULL_RUBY_BUILD: 1
jobs:
bump-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ steps.get-latest-tag.outputs.tag }}
level: prepatch
- uses: actions-ecosystem/action-push-tag@v1
with:
tag: v0.10.18-0
build:
runs-on: ${{ matrix.os }}
needs: [bump-tag]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
target: native
- os: macos-latest
target: native
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- if: runner.os == 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: 1.63.0
target: aarch64-apple-darwin
default: true
override: true
profile: minimal
- if: runner.os != 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: 1.63.0
override: true
profile: minimal
target: aarch64-unknown-linux-gnu
- if: runner.os == 'macOS'
run: |
brew install automake bison
echo "/usr/local/opt/bison/bin:$PATH" >> $GITHUB_PATH
- run: ./script/make_release
env:
TARGET: ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: rubyfmt-release-artifact-${{ matrix.os }}-${{ matrix.target }}
path: rubyfmt-*.tar.gz
source-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- run: |
TAG=$(git describe HEAD)
RELEASE_DIR="out/release"
mkdir -p ${RELEASE_DIR}
./script/make_source_release ${TAG}
- uses: actions/upload-artifact@v3
with:
name: rubyfmt-source-release
path: "out/release/source"
release:
runs-on: ubuntu-latest
needs:
- build
- source-release
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- uses: actions/download-artifact@v3
with:
name: rubyfmt-source-release
- uses: actions/download-artifact@v3
with:
name: rubyfmt-release-artifact-ubuntu-20.04-aarch64-unknown-linux-gnu
- uses: actions/download-artifact@v3
with:
name: rubyfmt-release-artifact-ubuntu-20.04-native
- uses: actions/download-artifact@v3
with:
name: rubyfmt-release-artifact-macos-latest-native
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
files: rubyfmt-*.tar.gz
fail_on_unmatched_files: true
generate_release_notes: true
prerelease: true
tag_name: ${{ steps.get-latest-tag.outputs.tag }}