release #44
This file contains 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 | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'New version' | |
required: true | |
jobs: | |
release: | |
name: "release" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
run_install: false | |
- name: Run release.sh | |
run: bash release.sh ${{ inputs.version }} | |
- name: commit version | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: v${{ inputs.version }} Release | |
tagging_message: v${{ inputs.version }} | |
- name: Setup nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'pnpm' | |
cache-dependency-path: 'frontend/pnpm-lock.yaml' | |
- name: Install modules | |
working-directory: ./frontend | |
run: pnpm install --frozen-lockfile --strict-peer-dependencies | |
- name: Prettier | |
working-directory: ./frontend | |
run: pnpm build | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Import GPG key | |
# id: import_gpg | |
# uses: crazy-max/ghaction-import-gpg@v6 | |
# with: | |
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
# passphrase: ${{ secrets.PASSPHRASE }} | |
- uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: "~> v1" | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }} | |
# DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
- name: Upload snapshot | |
uses: actions/upload-artifact@v3 | |
with: | |
name: snapshot | |
path: build/* | |
retention-days: 1 | |
- name: Build & publish image | |
run: | | |
docker build . --tag ghcr.io/leighmacdonald/gbans:v${{ inputs.version }} | |
docker push ghcr.io/leighmacdonald/gbans:v${{ inputs.version }} | |
docker build . --tag ghcr.io/leighmacdonald/gbans:latest | |
docker push ghcr.io/leighmacdonald/gbans:latest | |
- name: Update contributor list | |
uses: akhilmhdh/contributors-readme-action@v2.3.10 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |