Update audible.rs - fix suffix for au locale (#793) #496
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: Release | |
on: | |
push: | |
tags: | |
- "*-?v[0-9]+*" | |
env: | |
REGISTRY: ghcr.io | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create or update release | |
uses: actions/github-script@v7 | |
env: | |
TAG_NAME: ${{ github.ref_name }} | |
with: | |
script: | | |
const tag = process.env.TAG_NAME || github.ref_name; | |
const repo = context.repo; | |
const majorVersion = tag.match(/v(\d+)\.\d+\.\d+/)[1]; | |
const releaseName = `Version ${majorVersion}`; | |
const date = new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); | |
const dynamicBody = `<!-- DYNAMIC START -->\n*Created from tag*: \`${tag}\`\n*Created from git revision*: \`${context.sha}\`\n*Published on*: \`${date}\`\n<!-- DYNAMIC END -->`; | |
async function findOrCreateRelease() { | |
const { data: releases } = await github.rest.repos.listReleases(repo); | |
let existingRelease = releases.find(release => release.name === releaseName); | |
if (existingRelease) { | |
const existingBody = existingRelease.body; | |
const newBody = existingBody.replace(/<!-- DYNAMIC START -->[^]*<!-- DYNAMIC END -->/, dynamicBody); | |
await github.rest.repos.updateRelease({ | |
...repo, | |
release_id: existingRelease.id, | |
tag_name: tag, | |
body: newBody | |
}); | |
console.log("Release updated to associate with new tag."); | |
} else { | |
const fullBody = `${dynamicBody}\n\n## Release Notes\n\n- Some bug fixes.`; | |
await github.rest.repos.createRelease({ | |
...repo, | |
tag_name: tag, | |
name: releaseName, | |
body: fullBody, | |
draft: false, | |
prerelease: false | |
}); | |
console.log("Release created successfully."); | |
} | |
} | |
findOrCreateRelease(); | |
docker-release: | |
runs-on: ubuntu-latest | |
needs: create-release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get docker image name and build args | |
id: required_args | |
run: | | |
image_name="${{ env.REGISTRY }}/${{ github.actor }}/${{ github.event.repository.name }}" | |
image_names="$image_name:${{ github.ref_name }},$image_name:latest" | |
# lowercase the name | |
image_names=$(echo "$image_names" | tr '[:upper:]' '[:lower:]') | |
echo "image_names=$image_names" >> $GITHUB_OUTPUT | |
- name: Build and push to ghcr | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.required_args.outputs.image_names }} | |
upload-kodi-plugin: | |
runs-on: ubuntu-20.04 | |
needs: docker-release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Moon | |
uses: moonrepo/setup-toolchain@v0 | |
with: | |
auto-install: true | |
- name: Build plugin | |
run: moon run kodi:build | |
- name: Upload plugin to releases | |
run: gh release upload --clobber ${{ github.ref_name }} "tmp/script.ryot.zip" | |
deploy-demo-instance: | |
runs-on: ubuntu-latest | |
needs: docker-release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up CLI | |
uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Deploy | |
run: flyctl deploy --remote-only --detach --config ci/fly.toml | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
deploy-docs: | |
runs-on: ubuntu-latest | |
needs: docker-release | |
defaults: | |
run: | |
working-directory: docs | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Install dependencies | |
run: poetry install | |
- name: Deploy to github pages | |
run: poetry run mkdocs gh-deploy --force |