Update from upstream #180
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: Update from upstream | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
publish: | |
name: Publish new tag | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_PAT }} | |
- name: Get local tags | |
uses: dysnix/find-latest-tag@v1 | |
id: upstream | |
with: | |
releases-only: true | |
regex: v1\.18\.[0-9]+$ | |
repository: solana-labs/solana | |
- name: Get local tags | |
uses: dysnix/find-latest-tag@v1 | |
id: latest | |
with: | |
compared-to-tag: ${{ steps.upstream.outputs.tag }} | |
regex: v1\.18\.[0-9]+$ | |
repository: ${{ github.repository }} | |
- name: Update Dockerfile base | |
if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' | |
run: sed -E -i 's/v[0-9]+\.[0-9]+\.[0-9]+/${{ steps.upstream.outputs.tag }}/g' Dockerfile | |
- name: Create tag | |
if: steps.latest.outputs.newer == 'true' || steps.latest.outputs.tag == '' | |
run: | | |
git config --global user.email "tech@dysnix.com" | |
git config --global user.name "dysnixbot" | |
git add -A | |
git commit -m "Upstream update ${{ steps.upstream.outputs.tag }}" | |
git push origin ${{ github.ref_name }} | |
git tag ${{ steps.upstream.outputs.tag }} | |
git push origin ${{ steps.upstream.outputs.tag }} |