-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
91 lines (80 loc) · 2.65 KB
/
action.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
---
name: "Generate THIRDPARTY"
description: "Generate license listing of third party dependencies in Artichoke Ruby"
branding:
icon: "book"
color: "green"
inputs:
artichoke_ref:
required: true
type: string
target_triple:
required: true
type: string
output_file:
required: true
type: string
github_token:
required: true
type: string
runs:
using: "composite"
steps:
# https://github.com/actions/checkout/issues/135
- name: Setup git line ending checkout behavior
shell: bash
if: runner.os == 'Windows'
run: |
git config --system core.autocrlf false
git config --system core.eol lf
# `actions/checkout` only permits checkouts within the `github.workspace`
# directory. See https://github.com/actions/checkout/issues/197.
- name: Set paths
shell: bash
id: paths
run: |
temp_prefix="${{ github.workspace }}/${{ github.action }}-${{ github.run_id }}-${{ github.run_attempt }}"
mkdir -p "$temp_prefix"
artichoke_repository_path="${temp_prefix}/artichoke@${{ inputs.artichoke_ref }}"
echo "CLEANUP_PATH=${temp_prefix}" >> "$GITHUB_OUTPUT"
echo "ARTICHOKE_REPOSITORY_PATH=${artichoke_repository_path}" >> "$GITHUB_OUTPUT"
echo "CARGO_MANIFEST_PATH=${artichoke_repository_path}/Cargo.toml" >> "$GITHUB_OUTPUT"
- name: Clone Artichoke
uses: actions/[email protected]
with:
repository: artichoke/artichoke
ref: ${{ inputs.artichoke_ref }}
path: ${{ steps.paths.outputs.ARTICHOKE_REPOSITORY_PATH }}
- name: Install generate_third_party
shell: bash
run: |
gem build generate_third_party.gemspec
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo gem install generate_third_party-1.14.0.gem
else
gem install generate_third_party-1.14.0.gem
fi
working-directory: ${{ github.action_path }}
- name: Install cargo-about
shell: bash
run: install-cargo-about --platform "${{ runner.os }}"
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
- name: cargo about --version
shell: bash
run: cargo about --version
- name: Update stable rust
shell: bash
run: rustup update stable
- name: Generate THIRDPARTY
shell: bash
run: |
generate-third-party-text-file-single-target \
--target "${{ inputs.target_triple }}" \
"${{ steps.paths.outputs.CARGO_MANIFEST_PATH }}" \
> "${{ inputs.output_file }}"
env:
RUST_TOOLCHAIN: stable
- name: Cleanup
shell: bash
run: rm -rf "${{ steps.paths.outputs.CLEANUP_PATH }}"