-
-
Notifications
You must be signed in to change notification settings - Fork 8
98 lines (96 loc) · 3.23 KB
/
release.yml
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
name: release
on:
push:
branches:
- main
paths:
- 'src/**'
- package.json
- API.md
workflow_dispatch: {}
env:
CI: "true"
jobs:
release_github:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set git identity
run: |-
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Zig toolchain
uses: korandoru/setup-zig@v1
with:
zig-version: 0.13.0
- name: Install Cargo Lambda
uses: jaxxstorm/[email protected]
with:
repo: cargo-lambda/cargo-lambda
tag: v1.5.0
platform: linux
arch: x86_64
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.x'
- uses: actions/setup-go@v4
with:
go-version: '1.x'
- uses: actions/setup-java@v4
with:
java-version: '17.x'
distribution: 'temurin'
- uses: actions/setup-python@v5
with:
python-version: 3.12.3
- name: Install NPM dependencies
run: npx projen install:ci
- name: Build
run: npx projen build --verbose
- name: Release
run: npx projen release
- name: Release GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
run: errout=$(mktemp); gh release create $(cat dist/releasetag.txt) -R $GITHUB_REPOSITORY -F dist/changelog.md -t $(cat dist/releasetag.txt) --target $GITHUB_REF 2> $errout && true; exitcode=$?; if [ $exitcode -ne 0 ] && ! grep -q "Release.tag_name already exists" $errout; then cat $errout; exit $exitcode; fi
- name: Release JS Artifact
env:
NPM_DIST_TAG: latest
NPM_REGISTRY: registry.npmjs.org
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx -p publib@latest publib-npm
- name: Release Java Artifact
env:
MAVEN_SERVER_ID: 'github'
MAVEN_REPOSITORY_URL: 'https://maven.pkg.github.com/cargo-lambda/cargo-lambda-cdk'
MAVEN_ENDPOINT: 'https://maven.pkg.github.com'
MAVEN_USERNAME: ${{ github.actor }}
MAVEN_PASSWORD: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }}
run: npx -p publib@latest publib-maven
- name: Release Python Artifact
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: npx -p publib@latest publib-pypi
- name: Release Dotnet Artifact
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: npx -p publib@latest publib-nuget
- name: Release Go Artifact
env:
GIT_USER_NAME: github-actions
GIT_USER_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.CDK_PACKAGES_REGISTRY_GITHUB_TOKEN }}
run: npx -p publib@latest publib-golang