py: sort resource names in families #72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Canary & Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| canary-release: | |
| # Skip if commit message contains [skip ci] or starts with "chore: release" | |
| if: | | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !startsWith(github.event.head_commit.message, 'chore: release') && | |
| !startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run tests | |
| run: bun test | |
| - name: Run typecheck | |
| run: bun run typecheck | |
| - name: Build | |
| run: bun run build | |
| - name: Generate canary version | |
| id: version | |
| run: | | |
| COMMIT_SHA=$(git rev-parse --short HEAD) | |
| TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
| CANARY_VERSION_SUFFIX="-canary.${TIMESTAMP}.${COMMIT_SHA}" | |
| echo "canary_version_suffix=${CANARY_VERSION_SUFFIX}" >> $GITHUB_OUTPUT | |
| echo "Generated canary version suffix: ${CANARY_VERSION_SUFFIX}" | |
| - name: Update package.json version | |
| run: | | |
| bun --bun -e " | |
| const pkg = require('./package.json'); | |
| pkg.version = pkg.version + '${{ steps.version.outputs.canary_version_suffix }}'; | |
| console.log('Canary version:', pkg.version); | |
| require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2)); | |
| " | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Publish canary release | |
| run: npm publish --tag canary --access public | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Run tests | |
| run: bun test | |
| - name: Run typecheck | |
| run: bun run typecheck | |
| - name: Build | |
| run: bun run build | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Publish release | |
| run: npm publish --tag latest --access public | |
| - name: Create Github Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: ${{ github.ref_name }} | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| token: ${{ secrets.RELEASE_GITHUB_TOKEN }} |