ci: GH-3 Defining changeset workflow (#9) #1
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: Publish Changesets | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install tools | |
| run: go install tool | |
| - name: Validate release prerequisites | |
| run: | | |
| test -f go.work || (echo "go.work missing" && exit 1) | |
| test -f version.txt || (echo "version.txt missing" && exit 1) | |
| - name: Regenerate SDK | |
| run: make all | |
| - name: Publish tags and GitHub release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| REPO_OWNER: ${{ github.repository_owner }} | |
| REPO_NAME: ${{ github.event.repository.name }} | |
| run: | | |
| changeset each --filter outdated-versions -- \ | |
| changeset publish --owner "$REPO_OWNER" --repo "$REPO_NAME" |