Skip to content
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
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Sample workflow for refactoring set-output to use environment variables

name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set version environment variables
run: |
echo "VERSION_NAME=${{ env.VERSION_NAME }}" >> $GITHUB_ENV
echo "VERSION_CODE=${{ env.VERSION_CODE }}" >> $GITHUB_ENV
- name: Use version environment variables
run: |
echo "Version Name: $VERSION_NAME"
echo "Version Code: $VERSION_CODE"
14 changes: 9 additions & 5 deletions .github/workflows/on-demand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
- name: Get branch name
# see https://github.com/actions/checkout/issues/331
id: get-branch
run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
run: |
BRANCH=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
echo "branch=$BRANCH" >> $GITHUB_ENV
env:
REPO: ${{ github.repository }}
PR_NO: ${{ github.event.issue.number }}
Expand All @@ -28,7 +30,7 @@ jobs:
with:
fetch-depth: 1
# grab the PR branch
ref: ${{ steps.get-branch.outputs.branch }}
ref: ${{ env.branch }}
# We can't use GITHUB_TOKEN here because, github actions can't trigger actions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# So this is a personal access token
Expand Down Expand Up @@ -79,7 +81,9 @@ jobs:
- name: Get branch name
# see https://github.com/actions/checkout/issues/331
id: get-branch
run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
run: |
BRANCH=$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
echo "branch=$BRANCH" >> $GITHUB_ENV
env:
REPO: ${{ github.repository }}
PR_NO: ${{ github.event.issue.number }}
Expand All @@ -89,7 +93,7 @@ jobs:
with:
fetch-depth: 1
# grab the PR branch
ref: ${{ steps.get-branch.outputs.branch }}
ref: ${{ env.branch }}
# We can't use GITHUB_TOKEN here because, github actions can't trigger actions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# So this is a personal access token
Expand All @@ -114,4 +118,4 @@ jobs:
push_options: ""
status_options: '--untracked-files=no'
skip_dirty_check: false
create_branch: no
create_branch: no
12 changes: 7 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
RUBY_VERSION: 3.2.0


jobs:
release-please:
Expand Down Expand Up @@ -45,8 +45,8 @@ jobs:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
outputs:
VERSION_NAME: ${{ steps.set_output.outputs.VERSION_NAME }}
VERSION_CODE: ${{ steps.set_output.outputs.VERSION_CODE }}
VERSION_NAME: ${{ env.VERSION_NAME }}
VERSION_CODE: ${{ env.VERSION_CODE }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -105,7 +105,9 @@ jobs:

- name: Set output
id: set_output
run: echo "::set-output name=VERSION_NAME::${{ env.VERSION_NAME }}" && echo "::set-output name=VERSION_CODE::${{ env.VERSION_CODE }}"
run: |
echo "VERSION_NAME=${{ env.VERSION_NAME }}" >> $GITHUB_ENV
echo "VERSION_CODE=${{ env.VERSION_CODE }}" >> $GITHUB_ENV

android-release:
concurrency:
Expand Down Expand Up @@ -199,4 +201,4 @@ jobs:
STORE_JKS_DECRYPTKEY: ${{secrets.NEW_CYPHER }}
SIGN_STORE_PASSWORD: ${{secrets.DECRYPT_FOR_SCANNER_FILE }}
SIGN_KEY_ALIAS: ${{secrets.ALIAS_FOR_SCANNER }}
SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }}
SIGN_KEY_PASSWORD: ${{secrets.KEY_FOR_SCANNER }}
Loading