Repository navigation
126 lines (119 loc) · 4.41 KB
/
Copy pathrelease.yml
File metadata and controls
126 lines (119 loc) · 4.41 KB
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
# Generated from release.toml by `release` · sha256:26f699712a0976b1755f3e09dc81992843841cb4b53a5305dccb56b0dc2729bd
name: Release
on:
push:
branches: [main]
permissions:
contents: write # create tags and GitHub Releases
id-token: write
concurrency:
group: release
cancel-in-progress: false
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_release: ${{ steps.check.outputs.should_release }}
release_opentf_obj_diff: ${{ steps.check.outputs.release_opentf_obj_diff }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install release
shell: bash
env:
OTF_RELEASE_VERSION: v0.42.0
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/v0.42.0/install.sh | bash
- name: Expose release command
shell: bash
run: |
if ! command -v release >/dev/null 2>&1; then
mkdir -p "$RUNNER_TEMP/release-cli"
cp "$(command -v otf-release)" "$RUNNER_TEMP/release-cli/release"
echo "$RUNNER_TEMP/release-cli" >> "$GITHUB_PATH"
fi
- id: check
run: |
echo "should_release=$(release check --exclude-package @opentf/obj-diff)" >> "$GITHUB_OUTPUT"
echo "release_opentf_obj_diff=$(release check --package @opentf/obj-diff)" >> "$GITHUB_OUTPUT"
publish-opentf-obj-diff:
needs: [check-release]
if: needs.check-release.outputs.release_opentf_obj_diff == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- name: Setup
shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/ES-Runtime/main/install.sh | bash -s -- --only=esdev
echo "$HOME/.es-runtime/bin" >> "$GITHUB_PATH"
- name: Build @opentf/obj-diff
run: esdev build --target=library
working-directory: packages/obj-diff
- name: Install release
shell: bash
env:
OTF_RELEASE_VERSION: v0.42.0
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/v0.42.0/install.sh | bash
- name: Expose release command
shell: bash
run: |
if ! command -v release >/dev/null 2>&1; then
mkdir -p "$RUNNER_TEMP/release-cli"
cp "$(command -v otf-release)" "$RUNNER_TEMP/release-cli/release"
echo "$RUNNER_TEMP/release-cli" >> "$GITHUB_PATH"
fi
- name: Publish
run: release publish --package @opentf/obj-diff
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: [check-release, publish-opentf-obj-diff]
if: >-
always() &&
needs.check-release.outputs.should_release == 'true' &&
needs.publish-opentf-obj-diff.result != 'failure' &&
needs.publish-opentf-obj-diff.result != 'cancelled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- name: Install release
shell: bash
env:
OTF_RELEASE_VERSION: v0.42.0
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/v0.42.0/install.sh | bash
- name: Expose release command
shell: bash
run: |
if ! command -v release >/dev/null 2>&1; then
mkdir -p "$RUNNER_TEMP/release-cli"
cp "$(command -v otf-release)" "$RUNNER_TEMP/release-cli/release"
echo "$RUNNER_TEMP/release-cli" >> "$GITHUB_PATH"
fi
- name: Setup
shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/ES-Runtime/main/install.sh | bash -s -- --only=esdev
echo "$HOME/.es-runtime/bin" >> "$GITHUB_PATH"
- name: Publish
run: release publish --exclude-package @opentf/obj-diff
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}