Skip to content

Commit 0a81814

Browse files
committed
ci: release actions and pinning third party actions versions
1 parent 9838e4a commit 0a81814

File tree

4 files changed

+110
-8
lines changed

4 files changed

+110
-8
lines changed

.github/workflows/codestyle.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout Code
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414

1515
- name: Setup PNPM
1616
uses: dfinity/ci-tools/actions/setup-pnpm@main
1717

1818
- name: Check JS Codestyle
1919
run: pnpm codestyle:check
20-
21-
- name: Check Rust Linting
22-
run: cargo clippy
23-
24-
- name: Check Rust formatting
25-
run: cargo fmt -- --check
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: create_release_pr
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create_release_pr:
8+
name: create_release_pr
9+
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Create GitHub App Token
15+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 #v2.1.4
16+
id: generate_token
17+
with:
18+
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
19+
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
20+
21+
- name: Checkout Code
22+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Python
27+
uses: dfinity/ci-tools/actions/setup-python@main
28+
29+
- name: Setup Commitizen
30+
uses: dfinity/ci-tools/actions/setup-commitizen@main
31+
32+
- name: Setup PNPM
33+
uses: dfinity/ci-tools/actions/setup-pnpm@main
34+
35+
- name: Build package
36+
run: pnpm build
37+
38+
- name: Bump version
39+
id: bump_version
40+
uses: dfinity/ci-tools/actions/bump-version@main
41+
with:
42+
major_version_zero: true
43+
44+
- name: Print Version
45+
run: echo "Bumping to version ${{ steps.bump_version.outputs.version }}"
46+
47+
- name: Create Pull Request
48+
uses: dfinity/ci-tools/actions/create-pr@main
49+
with:
50+
token: ${{ steps.generate_token.outputs.token }}
51+
branch_name: 'release/${{ steps.bump_version.outputs.version }}'
52+
pull_request_title: 'chore: release ${{ steps.bump_version.outputs.version }}'
53+
pull_request_body: |
54+
After merging this PR, tag the merge commit with:
55+
```shell
56+
git tag ${{ steps.bump_version.outputs.version }}
57+
git push origin ${{ steps.bump_version.outputs.version }}
58+
```
59+
commit_message: 'chore: release ${{ steps.bump_version.outputs.version }}'

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
- '[0-9]+.[0-9]+.[0-9]+b[0-9]+'
8+
9+
jobs:
10+
release:
11+
name: release
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: release
15+
url: https://www.npmjs.com/package/@dfinity/typedoc-plugin-icp-docs
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
20+
- name: Setup Python
21+
uses: dfinity/ci-tools/actions/setup-python@main
22+
23+
- name: Setup Commitizen
24+
uses: dfinity/ci-tools/actions/setup-commitizen@main
25+
26+
- name: Setup PNPM
27+
uses: dfinity/ci-tools/actions/setup-pnpm@main
28+
29+
- name: Build NPM package
30+
run: pnpm build
31+
32+
- name: Generate release notes
33+
uses: dfinity/ci-tools/actions/generate-release-notes@main
34+
35+
- name: Publish to npm
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
38+
NPM_CONFIG_PROVENANCE: 'true'
39+
run: |
40+
pnpm publish --verbose --access public
41+
42+
- name: Create Github release
43+
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
44+
with:
45+
bodyFile: 'RELEASE_NOTES.md'
46+
tag: '${{ github.ref_name }}'
47+
commit: 'main'
48+
prerelease: false
49+
makeLatest: true

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout Code
13-
uses: actions/checkout@v4
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414

1515
- name: Setup PNPM
1616
uses: dfinity/ci-tools/actions/setup-pnpm@main

0 commit comments

Comments
 (0)