-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-node
- Loading branch information
Showing
3 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Check for firebase-tools releases | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
check-releases: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
# A semver comparison result - We are the base, firebase-tools is the compare-to | ||
comparison: ${{ steps.compare_versions.outputs.comparison-result }} | ||
firebase-actions-release: ${{ fromJSON(steps.get_our_release.outputs.data).tag_name }} | ||
firebase-tools-release: ${{ fromJSON(steps.get_their_release.outputs.data).tag_name }} | ||
steps: | ||
- name: Check our latest release | ||
uses: octokit/[email protected] | ||
id: get_our_release | ||
with: | ||
route: GET /repos/${{ github.REPOSITORY }}/releases/latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check latest firebase-tools release | ||
uses: octokit/[email protected] | ||
id: get_their_release | ||
with: | ||
route: GET /repos/firebase/firebase-tools/releases/latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: madhead/semver-utils@latest | ||
id: compare_versions | ||
with: | ||
# A version to work with | ||
version: "${{ fromJSON(steps.get_our_release.outputs.data).tag_name }}" | ||
# A version to compare against | ||
compare-to: "${{ fromJSON(steps.get_their_release.outputs.data).tag_name }}" | ||
|
||
- name: Print our release version | ||
run: echo "Our latest release is ${{ fromJSON(steps.get_our_release.outputs.data).tag_name }}" | ||
- name: Print their release version | ||
run: echo "Their latest release is ${{ fromJSON(steps.get_their_release.outputs.data).tag_name }}" | ||
- name: Print the result | ||
run: echo "${{ fromJSON(steps.get_our_release.outputs.data).tag_name }} ${{ steps.compare_versions.outputs.comparison-result }} ${{ fromJSON(steps.get_their_release.outputs.data).tag_name }}" | ||
|
||
bump-version: | ||
needs: check-releases | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.check-releases.outputs.comparison == '<' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "master" | ||
|
||
- name: Remove leading 'v' from version numbers | ||
run: | | ||
FIREBASE_ACTIONS_RELEASE=${{ needs.check-releases.outputs.firebase-actions-release }} | ||
FIREBASE_TOOLS_RELEASE=${{ needs.check-releases.outputs.firebase-tools-release }} | ||
echo "FIREBASE_ACTIONS_RELEASE=${FIREBASE_ACTIONS_RELEASE#v}" >> $GITHUB_ENV | ||
echo "FIREBASE_TOOLS_RELEASE=${FIREBASE_TOOLS_RELEASE#v}" >> $GITHUB_ENV | ||
- name: Bump version | ||
id: bump-version | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
with: | ||
find: "${{ env.FIREBASE_ACTIONS_RELEASE }}" | ||
replace: "${{ env.FIREBASE_TOOLS_RELEASE }}" | ||
include: "{Dockerfile,action.yaml}" | ||
regex: false | ||
|
||
- name: Commit & Push changes | ||
if: ${{ steps.bump-version.outputs.modifiedFiles > 0 }} | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git commit -a -m "Bump firebase-tools to ${{ needs.check-releases.outputs.firebase-tools-release }}" | ||
git tag -a ${{ needs.check-releases.outputs.firebase-tools-release }} -m "Bump firebase-tools to ${{ needs.check-releases.outputs.firebase-tools-release }}" | ||
git push origin HEAD:master --tags | ||
- name: Create Release | ||
id: create_release | ||
uses: comnoco/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ needs.check-releases.outputs.firebase-tools-release }} | ||
release_name: firebase-tools ${{ needs.check-releases.outputs.firebase-tools-release }} | ||
body: "Bump `firebase-tools` to ${{ needs.check-releases.outputs.firebase-tools-release }}" | ||
draft: false | ||
prerelease: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM node:18.18.2-buster | ||
|
||
LABEL version="12.8.0" | ||
LABEL version="13.0.1" | ||
LABEL repository="https://github.com/w9jds/firebase-action" | ||
LABEL homepage="https://github.com/w9jds/firebase-action" | ||
LABEL maintainer="Jeremy Shore <[email protected]>" | ||
|
@@ -13,7 +13,7 @@ LABEL com.github.actions.color="gray-dark" | |
RUN apt update && apt-get install --no-install-recommends -y jq openjdk-11-jre && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN npm i -g [email protected] && npm cache clean --force | ||
RUN npm i -g firebase-tools@12.8.0 && npm cache clean --force | ||
RUN npm i -g firebase-tools@13.0.1 && npm cache clean --force | ||
|
||
COPY LICENSE README.md / | ||
COPY "entrypoint.sh" "/entrypoint.sh" | ||
|
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