-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (91 loc) · 3.15 KB
/
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
name: 'Release'
on:
workflow_dispatch:
inputs:
versionBumpType:
description: 'Version Bump Type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
# TODO remove after test
pull_request:
env:
MAINTAINER_TEAM: cli
jobs:
build-targets:
name: build-targets
runs-on: ubuntu-22.04
env:
GOPRIVATE: github.com/opentdf/platform/*
BIN_NAME: otdfctl
steps:
- name: Is actor in ${{ env.MAINTAINER_TEAM }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log('context', context);
const org = context.repo.owner;
console.log('org', org);
const team_slug = "${{ env.MAINTAINER_TEAM }}";
console.log('team_slug', team_slug);
const username = context.actor;
console.log('username', username);
// API request to check team membership
try {
const { data } = await github.rest.teams.getMembershipForUserInOrg({
org,
team_slug,
username,
})
// if (response.data.state === 'active') {
// console.log(`${username} is a member of the team ${team_slug}.`);
// } else {
// console.log(`${username} is not an active member of the team ${team_slug}.`);
// core.setFailed(`${username} is not an active member of the team ${team_slug}.`);
// }
// } catch(error) {
// console.log(`Error checking membership: ${error}`);
// core.setFailed(`Error checking membership: ${error}`);
// }
console.log(data);
} catch (error) {
console.error(error);
}
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version-file: './go.mod'
# cache: false
# - name: Get next version
# uses: reecetech/[email protected]
# id: version
# with:
# release_branch: main
# scheme: semver
# increment: ${{ github.event.inputs.versionBumpType }}
# pep440: false
# - name: print-version
# run: echo Incrementing Version ${{ steps.version.outputs.current-v-version }} -> ${{ steps.version.outputs.v-version }}
# - name: make-targets
# env:
# SEM_VER: ${{ steps.version.outputs.v-version }}
# run: make build
# - name: smoke-test
# run: go test ./... -short -race -cover
# - name: Compress the builds and generate checksums
# env:
# SEM_VER: ${{ steps.version.outputs.v-version }}
# run: make zip-builds
# - name: Release
# uses: softprops/action-gh-release@v2
# with:
# files: './output/**/*'
# body: 'This is a test release, and will be removed'
# tag_name: ${{ steps.version.outputs.v-version }}
# repository: opentdf/otdfctl
# generate_release_notes: true