chore: version to 0.10.2 (#621) #16
Workflow file for this run
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: publish | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
jobs: | |
npm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@42d299face0c5c43a0487c477f595ac9cf22f1a7 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@e5622373a38e60fb6d795a4421e56882f2d7a681 | |
with: | |
images: freyrcli/freyrjs | |
tags: | | |
type=ref,event=tag | |
type=semver,pattern={{raw}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@7f9d37fa544684fb73bfe4835ed7214c255ce02b | |
with: | |
context: . | |
push: true | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
release: | |
runs-on: ubuntu-latest | |
needs: [ npm, docker ] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
# fetch tags for cargo ws publish | |
# might be a simple `fetch-tags: true` option soon, see https://github.com/actions/checkout/pull/579 | |
fetch-depth: 0 | |
- name: Bootstrap | |
run: | | |
git config user.name github-actions | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
GIT_CURRENT_TAG="${GITHUB_REF#refs/tags/}" | |
echo "::notice::Current Git Tag: \"${GIT_CURRENT_TAG}\"" | |
echo "GIT_CURRENT_TAG=${GIT_CURRENT_TAG}" >> "$GITHUB_ENV" | |
GIT_CURRENT_TAG_COMMIT="$(git rev-list -n1 "${GIT_CURRENT_TAG}")" | |
GIT_PREVIOUS_REF="$(git describe --tags --abbrev=0 "${GIT_CURRENT_TAG_COMMIT}^1" 2>/dev/null || git rev-list --max-parents=0 HEAD)" | |
echo "::notice::Previous Git Tag / Ref: \"${GIT_PREVIOUS_REF}\"" | |
echo "GIT_PREVIOUS_REF=${GIT_PREVIOUS_REF}" >> "$GITHUB_ENV" | |
echo "FREYR_VERSION=${GIT_CURRENT_TAG#v}" >> "$GITHUB_ENV" | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@c24866884b7a0d2fd2095be2e406b6f260479da8 | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.GIT_CURRENT_TAG }} | |
release_name: ${{ env.GIT_CURRENT_TAG }} | |
body: | | |
[![][npm-badge]][npm-url] [![][docker-badge]][docker-url] [![][github-badge]][github-url] | |
## What's changed? | |
${{ steps.extract-release-notes.outputs.release_notes }} | |
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ env.GIT_PREVIOUS_REF }}...${{ env.GIT_CURRENT_TAG }} | |
[npm-url]: https://www.npmjs.com/package/freyr/v/${{ env.FREYR_VERSION }} | |
[npm-badge]: https://img.shields.io/badge/npm-gray?logo=npm | |
[docker-url]: https://hub.docker.com/r/freyrcli/freyrjs/tags?name=v${{ env.FREYR_VERSION }} | |
[docker-badge]: https://img.shields.io/badge/docker-gray?logo=docker | |
[github-url]: https://github.com/miraclx/freyr-js/releases/tag/v${{ env.FREYR_VERSION }} | |
[github-badge]: https://img.shields.io/badge/github-gray?logo=github |