-
-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (86 loc) · 3.22 KB
/
Copy pathrelease.yml
File metadata and controls
92 lines (86 loc) · 3.22 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
name: Release
on:
push:
branches: [main]
permissions:
contents: write # create tags and GitHub Releases
id-token: write # npm provenance (packages/obj-diff publishConfig.provenance: true)
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 otf-release
if: runner.os != 'Windows'
shell: bash
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.sh | bash
- name: Install otf-release
if: runner.os == 'Windows'
shell: pwsh
run: irm https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.ps1 | iex
- id: check
run: |
echo "should_release=$(otf-release check --exclude-package @opentf/obj-diff)" >> "$GITHUB_OUTPUT"
echo "release_opentf_obj_diff=$(otf-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: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: bun install --frozen-lockfile
- name: Build @opentf/obj-diff
run: npm run build
working-directory: packages/obj-diff
- name: Install otf-release
if: runner.os != 'Windows'
shell: bash
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.sh | bash
- name: Install otf-release
if: runner.os == 'Windows'
shell: pwsh
run: irm https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.ps1 | iex
- name: Publish
run: otf-release publish --package @opentf/obj-diff
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
needs: [check-release]
if: needs.check-release.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
- run: bun install --frozen-lockfile
- name: Install otf-release
if: runner.os != 'Windows'
shell: bash
run: curl -fsSL https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.sh | bash
- name: Install otf-release
if: runner.os == 'Windows'
shell: pwsh
run: irm https://raw.githubusercontent.com/Open-Tech-Foundation/release/main/install.ps1 | iex
- name: Publish
run: otf-release publish --exclude-package @opentf/obj-diff
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}