.github/workflows/release.yml #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: Release init.lua | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Release version (semantic) | |
| required: true | |
| type: string | |
| branch: | |
| description: Branch to base the release on (e.g. main) | |
| required: true | |
| type: string | |
| default: main | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ inputs.branch }} | |
| - name: Install nix | |
| uses: cachix/install-nix-action@v31 | |
| with: | |
| extra_nix_config: | | |
| auto-optimise-store = true | |
| experimental-features = nix-command flakes | |
| substituters = https://cache.nixos.org/ https://nix-community.cachix.org/ | |
| trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= | |
| install_url: https://releases.nixos.org/nix/nix-2.28.0/install | |
| - name: Build init.lua | |
| run: nix build .#initLua | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: determinvim-${{ inputs.version }} | |
| path: ./result | |
| - name: Create and push tag | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git checkout ${{ inputs.branch }} | |
| git tag ${{ inputs.version }} | |
| git push origin ${{ inputs.version }} | |
| - name: Create release | |
| run: | | |
| gh release create ${{ inputs.version }} \ | |
| --title "v${{ inputs.version }}" \ | |
| --generate-notes \ | |
| ./result | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |