Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: dockerize release #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 31 additions & 18 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,40 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['12', '14', '16', 'lts/*']
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version-file: .nvmrc

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3

- run: npm ci
- run: npm run lint
# TODO: get this working
# - name: Release
# uses: cycjimmy/semantic-release-action@v3
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DOCKER_USERNAME: ${{ github.token }}
# with:
# semantic_version: 17
# extra_plugins: |
# @eclass/semantic-release-docker
# @semantic-release/git
# @semantic-release/changelog
# @semantic-release/exec

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: false

- name: Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ github.repository_owner }}
DOCKER_PASSWORD: ${{ secrets.GH_PACKAGES_TOKEN }}
with:
extra_plugins: |
@eclass/semantic-release-docker
@semantic-release/git
@semantic-release/changelog
@semantic-release/exec
21 changes: 21 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins:
- '@semantic-release/commit-analyzer'
- - '@semantic-release/exec'
- successCmd: echo 'yes' >> .release
failCmd: echo 'no' >> .release
- '@semantic-release/release-notes-generator'
- - '@semantic-release/npm'
- npmPublish: false
- '@semantic-release/github'
- - '@semantic-release/git'
- assets:
- package.json
- CHANGELOG.md
- - '@eclass/semantic-release-docker'
- baseImageName: libre-weather-api
registries:
- url: ghcr.io
imageName: ghcr.io/libreweather/libre-weather-api:latest
user: DOCKER_USERNAME
password: DOCKER_PASSWORD
branches: main
Loading