-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (74 loc) · 2.69 KB
/
Copy pathrelease.yml
File metadata and controls
90 lines (74 loc) · 2.69 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
name: Release
on:
push:
branches:
- main
permissions:
contents: write
issues: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.event.before != '0000000000000000000000000000000000000000'"
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup python symlink for gcloud installer
run: sudo ln -sf /usr/bin/python3 /usr/local/bin/python
- name: Setup mise
uses: jdx/mise-action@v4
- name: Install dependencies
run: mise run install
- name: Run tests
run: mise run test
- name: Run template tests
run: mise run test-template
- name: Create new version
id: upversion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: true
run: mise run upversion -- --ci
- name: Build production artifacts
if: steps.upversion.outputs.new_release_published == 'true'
run: mise run build-prod
- name: Authenticate with registry
if: steps.upversion.outputs.new_release_published == 'true' && env.GCP_SA_KEY != ''
uses: google-github-actions/auth@v2
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Setup gcloud
if: steps.upversion.outputs.new_release_published == 'true' && env.GCP_SA_KEY != ''
uses: google-github-actions/setup-gcloud@v2
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
- name: Publish package
if: steps.upversion.outputs.new_release_published == 'true' && env.GCP_SA_KEY != ''
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
GCP_REGISTRY_PROJECT_ID: ${{ secrets.GCP_REGISTRY_PROJECT_ID }}
GCP_REGISTRY_REGION: ${{ secrets.GCP_REGISTRY_REGION }}
GCP_REGISTRY_NAME: ${{ secrets.GCP_REGISTRY_NAME }}
run: mise run publish
- name: Create GitHub Release
if: steps.upversion.outputs.new_release_published == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.upversion.outputs.new_release_version }}
generate_release_notes: true
files: |
dist/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish template packages
if: steps.upversion.outputs.new_release_published == 'true'
run: mise run publish-templates
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}