name: release on: push: branches: [ main ] paths: [ CHANGELOG.md ] jobs: release: runs-on: ubuntu-latest permissions: id-token: write contents: write packages: write steps: - name: Checkout uses: actions/checkout@v7 - name: Setup Go uses: actions/setup-go@v7 with: go-version-file: 'go.mod' - name: Setup NPM uses: actions/setup-node@v7 with: node-version: '24.x' registry-url: 'https://registry.npmjs.org' - name: Login to GitHub Container Registry uses: docker/login-action@v4.6.0 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Add env vars run: | echo GORELEASER_CURRENT_TAG=$(go run main.go latest) >> $GITHUB_ENV tail -n +3 .changes/$(go run main.go latest).md > '${{ github.workspace }}/rel_notes.md' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v7.2.3 with: version: latest args: --clean --release-notes="${{ github.workspace}}/rel_notes.md" --skip=validate --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} WINGET_PAT: ${{ secrets.WINGET_PAT }} - uses: actions/setup-python@v7 with: python-version: 3.x - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - uses: actions/cache@v6 with: key: mkdocs-material-${{ env.cache_id }} path: .cache restore-keys: | mkdocs-material- - name: Publish to NPM run: | node npm/prepare-release.mjs npm publish --provenance - name: Build docs run: | go run main.go gen pip install -r requirements.txt mkdocs build - name: Deploy docs uses: peaceiris/actions-gh-pages@v4.1.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site cname: changie.dev